Make error more specific at connection failure
The UI does after all have enough information to determine if the disconnection event was received before or after we were connected. If we were never connected at all, we should adapt the error message to reflect this.
This commit is contained in:
parent
edb3ea4f88
commit
7f1049c0ee
|
@ -1099,6 +1099,8 @@ var UI = {
|
|||
},
|
||||
|
||||
disconnectFinished: function (e) {
|
||||
let wasConnected = UI.connected;
|
||||
|
||||
// This variable is ideally set when disconnection starts, but
|
||||
// when the disconnection isn't clean or if it is initiated by
|
||||
// the server, we need to do it here as well since
|
||||
|
@ -1107,8 +1109,12 @@ var UI = {
|
|||
|
||||
if (!e.detail.clean) {
|
||||
UI.updateVisualState('disconnected');
|
||||
if (wasConnected) {
|
||||
UI.showStatus(_("Something went wrong, connection is closed"),
|
||||
'error');
|
||||
} else {
|
||||
UI.showStatus(_("Failed to connect to server"), 'error');
|
||||
}
|
||||
} else if (UI.getSetting('reconnect', false) === true && !UI.inhibit_reconnect) {
|
||||
UI.updateVisualState('reconnecting');
|
||||
|
||||
|
|
Loading…
Reference in New Issue