diff --git a/app/assets/javascripts/channels/synchronized_editor_channel.js b/app/assets/javascripts/channels/synchronized_editor_channel.js index b87317c9..2cfdd13c 100644 --- a/app/assets/javascripts/channels/synchronized_editor_channel.js +++ b/app/assets/javascripts/channels/synchronized_editor_channel.js @@ -48,6 +48,13 @@ $(document).on('turbolinks:load', function () { CodeOceanEditor.showPartnersConnectionStatus(data.status, data.user.displayname); this.perform('connection_status'); } + // If a user has multiple open windows and closes one of them, + // the other group members will show that the user is offline. + // Therefore, we check if the person is still connected with another open window. + // Then, the user sends again their connection status. + else if (data.status === 'disconnected') { + this.perform('connection_status'); + } break; case 'connection_status': if (is_other_user(data.user)) {