From 3f7745b48b2581d8b2dbc0d2ab5227e7460a3f5f Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Tue, 30 Mar 2021 16:48:50 -0400 Subject: [PATCH] collab_client: Invert condition to improve readability --- src/static/js/collab_client.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/static/js/collab_client.js b/src/static/js/collab_client.js index e507d6b06..4d010af16 100644 --- a/src/static/js/collab_client.js +++ b/src/static/js/collab_client.js @@ -357,10 +357,9 @@ const getCollabClient = (ace2editor, serverVars, initialUserInfo, options, _pad) }; const setChannelState = (newChannelState, moreInfo) => { - if (newChannelState !== channelState) { - channelState = newChannelState; - callbacks.onChannelStateChange(channelState, moreInfo); - } + if (newChannelState === channelState) return; + channelState = newChannelState; + callbacks.onChannelStateChange(channelState, moreInfo); }; const valuesArray = (obj) => {