PadMessageHandler: Invert logic to improve readability

This commit is contained in:
Richard Hansen 2020-09-02 20:44:26 -04:00 committed by John McLear
parent d4db091d1d
commit 7f0770d684

View file

@ -260,7 +260,8 @@ exports.handleMessage = async function(client, message)
}
let dropMessage = await handleMessageHook();
if (!dropMessage) {
if (dropMessage) return;
if (message.type == "CLIENT_READY") {
// client tried to auth for the first time (first msg from the client)
createSessionInfo(client, message);
@ -299,7 +300,6 @@ exports.handleMessage = async function(client, message)
// access was granted
finalHandler();
}
}
/**