From 93a1e1fe949127f5edde96f15f5deee3ccfd1212 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Mon, 7 Jan 2019 12:35:52 +0100 Subject: [PATCH] ipc: prevent ipc reconnect notification on 1st connect --- src/client/app/ipc/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/client/app/ipc/index.js b/src/client/app/ipc/index.js index 6a3f82f4..115c2e4d 100644 --- a/src/client/app/ipc/index.js +++ b/src/client/app/ipc/index.js @@ -22,6 +22,7 @@ class Ipc extends EventEmitter { this.queue = [] + this.disconnectedOnce = false this.reconnect = undefined this.hearbeat = undefined @@ -66,7 +67,7 @@ class Ipc extends EventEmitter { }, hearbeatTimeout) }, hearbeatInterval) - if (notifications) notifications.add({ + if (notifications && this.disconnectedOnce) notifications.add({ icon: 'wifi', message: locales('server_connected'), id: 'ipc_state' @@ -101,6 +102,7 @@ class Ipc extends EventEmitter { id: 'ipc_state', duration: Infinity }) + this.disconnectedOnce = true if (!this.reconnect) { this.reconnect = setInterval(()=>{ this.open()