From 5f4c2c60be0442ff7ac4eac8b349e66c4fe3bb03 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Tue, 13 Feb 2024 21:31:46 +0100 Subject: [PATCH] ipc: prevent stuck disconnected notif --- src/client/ipc/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/client/ipc/index.js b/src/client/ipc/index.js index fe00f4bc..b5871add 100644 --- a/src/client/ipc/index.js +++ b/src/client/ipc/index.js @@ -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(()=>{