Correct connection status if user used multiple windows

This commit is contained in:
kiragrammel
2023-09-07 11:08:23 +02:00
committed by Sebastian Serth
parent 930d532fb6
commit 02e50e9921

View File

@ -48,6 +48,13 @@ $(document).on('turbolinks:load', function () {
CodeOceanEditor.showPartnersConnectionStatus(data.status, data.user.displayname); CodeOceanEditor.showPartnersConnectionStatus(data.status, data.user.displayname);
this.perform('connection_status'); 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; break;
case 'connection_status': case 'connection_status':
if (is_other_user(data.user)) { if (is_other_user(data.user)) {