From a5439e2cbf77c20ce2fb9364520176d6007ee08e Mon Sep 17 00:00:00 2001 From: Kevin Menhinick Date: Thu, 25 Mar 2021 23:11:28 +1300 Subject: [PATCH] (#1008) Move default handler to check for default route first --- src/events/websocket/WebSocketClients.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/events/websocket/WebSocketClients.js b/src/events/websocket/WebSocketClients.js index c661b25ab..abeebc1de 100644 --- a/src/events/websocket/WebSocketClients.js +++ b/src/events/websocket/WebSocketClients.js @@ -86,6 +86,10 @@ export default class WebSocketClients { if (!functionKey && route !== '$connect' && route !== '$disconnect') { functionKey = this.#webSocketRoutes.get('$default') + } + + if (!functionKey) { + debugLog(`Unhandled route '${route}'`) websocketClient.send( stringify({ @@ -95,10 +99,6 @@ export default class WebSocketClients { }), ) - debugLog(`Unhandled route '${route}'`) - } - - if (!functionKey) { return }