diff --git a/src/api/websocket.js b/src/api/websocket.js index d952372e5..ae2e5358f 100644 --- a/src/api/websocket.js +++ b/src/api/websocket.js @@ -141,13 +141,11 @@ export const handleMastoWS = ( if (data.result === 'success') { console.debug('[WS] Successfully authenticated') onAuthenticated() + } else if (data.error === 'already_authenticated') { + onAuthenticated() } else { - if (data.error === 'already_authenticated') { - onAuthenticated() - } else { - console.error('[WS] Unable to authenticate:', data.error) - wsEvent.target.close() - } + console.error('[WS] Unable to authenticate:', data.error) + wsEvent.target.close() } } return null