Skip to content

Commit

Permalink
use curly braces
Browse files Browse the repository at this point in the history
  • Loading branch information
marcaaron committed Apr 22, 2022
1 parent d781868 commit 216cc74
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/libs/PusherConnectionManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ function init() {
* @params {string} eventName
*/
Pusher.registerSocketEventCallback((eventName, error) => {
const errorType = lodashGet(error, 'type');
const code = lodashGet(error, 'data.code');
switch (eventName) {
case 'error':
case 'error': {
const errorType = lodashGet(error, 'type');
const code = lodashGet(error, 'data.code');
if (errorType === CONST.ERROR.PUSHER_ERROR && code === 1006) {
// 1006 code happens when a websocket connection is closed. There may or may not be a reason attached indicating why the connection was closed.
// https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.5
Expand All @@ -40,6 +40,7 @@ function init() {
Log.alert(`${CONST.ERROR.ENSURE_BUGBOT} [PusherConnectionManager] Unknown error event`, {error});
}
break;
}
case 'connected':
Log.info('[PusherConnectionManager] connected event');
break;
Expand Down

0 comments on commit 216cc74

Please sign in to comment.