ipc: prevent stuck disconnected notif

This commit is contained in:
jean-emmanuel 2024-02-13 21:31:46 +01:00
parent 5184498b9a
commit 5f4c2c60be

View file

@ -123,16 +123,17 @@ class Ipc extends EventEmitter {
clearTimeout(this.disconnectTimeout)
this.disconnectTimeout = setTimeout(()=>{
// delay notification in case reconnection succeeds quickly
if (notifications && this.disconnected) notifications.add({
if (notifications && !this.connected()) notifications.add({
icon: 'wifi',
class: 'error',
message: locales('server_disconnected'),
id: 'ipc_state',
duration: Infinity
})
this.disconnected = true
}, reconnectTimeout * 2)
this.disconnected = true
clearTimeout(this.reconnectTimeout)
this.reconnectTimeout = setTimeout(()=>{