defer connection failed message (#13)
This commit is contained in:
parent
1350d23ddd
commit
9f8811510f
|
|
@ -41,6 +41,7 @@ const UI = {
|
||||||
inhibitReconnect: true,
|
inhibitReconnect: true,
|
||||||
reconnectCallback: null,
|
reconnectCallback: null,
|
||||||
reconnectPassword: null,
|
reconnectPassword: null,
|
||||||
|
disconnectStatusTimeout: null,
|
||||||
|
|
||||||
prime() {
|
prime() {
|
||||||
return WebUtil.initSettings().then(() => {
|
return WebUtil.initSettings().then(() => {
|
||||||
|
|
@ -1135,6 +1136,8 @@ const UI = {
|
||||||
},
|
},
|
||||||
|
|
||||||
reconnect() {
|
reconnect() {
|
||||||
|
UI.disconnectStatusTimeout !== null && clearTimeout(UI.disconnectStatusTimeout);
|
||||||
|
UI.disconnectStatusTimeout = null;
|
||||||
UI.reconnectCallback = null;
|
UI.reconnectCallback = null;
|
||||||
|
|
||||||
// if reconnect has been disabled in the meantime, do nothing.
|
// if reconnect has been disabled in the meantime, do nothing.
|
||||||
|
|
@ -1191,7 +1194,11 @@ const UI = {
|
||||||
UI.showStatus(_("Something went wrong, connection is closed"),
|
UI.showStatus(_("Something went wrong, connection is closed"),
|
||||||
'error');
|
'error');
|
||||||
} else {
|
} else {
|
||||||
UI.showStatus(_("Failed to connect to server"), 'error');
|
UI.disconnectStatusTimeout !== null && clearTimeout(UI.disconnectStatusTimeout);
|
||||||
|
UI.disconnectStatusTimeout = setTimeout(() => {
|
||||||
|
UI.showStatus(_("Failed to connect to server"), 'error');
|
||||||
|
UI.disconnectStatusTimeout = null;
|
||||||
|
}, 20 * 1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// If reconnecting is allowed process it now
|
// If reconnecting is allowed process it now
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue