Skip to content

Commit

Permalink
Configurable "Real-time Connection Lost" Notification (#190)
Browse files Browse the repository at this point in the history
Co-authored-by: Chester Hawkins <[email protected]>
  • Loading branch information
chesterhawkins and Chester Hawkins authored Oct 11, 2024
1 parent c82f6b6 commit c8c126e
Showing 1 changed file with 2 additions and 21 deletions.
23 changes: 2 additions & 21 deletions src/realtime/MCWSStreamProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,27 +88,8 @@ define([

//Communicate websocket timeout and errors to users
if (data.onclose && data.code === 1006) {
let dialog = this.openmct.overlays.dialog({
iconClass: "alert",
message: 'Real-time data connection lost - data may not be displayed as expected. Please reload page to reconnect.',
buttons: [
{
label: "Cancel",
callback: function () {
dialog.dismiss();
}
},
{
label: "Reload",
emphasis: true,
callback: function () {
dialog.dismiss();
window.location.reload();
}
}
]
});

this.openmct.notifications.error('Real-time data connection lost - data may not be displayed as expected.');
console.error(`Real-time data connection lost - data may not be displayed as expected.`);
} else if (data.onerror) {
this.openmct.notifications.error('Websocket Error, please see console for details');
console.error(`Websocket Error - Code:${data.code}, Error:${data.reason}`);
Expand Down

0 comments on commit c8c126e

Please sign in to comment.