From 7850f7e505d450fce42c13d3673d719ad93e6692 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 26 Jan 2017 12:58:29 +0000 Subject: [PATCH] Fix badge spam: attempt 2 (#3073) --- src/vector/platform/ElectronPlatform.js | 1 + src/vector/platform/WebPlatform.js | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/vector/platform/ElectronPlatform.js b/src/vector/platform/ElectronPlatform.js index 47bfd990..c10f2f83 100644 --- a/src/vector/platform/ElectronPlatform.js +++ b/src/vector/platform/ElectronPlatform.js @@ -58,6 +58,7 @@ function platformFriendlyName() { export default class ElectronPlatform extends VectorBasePlatform { setNotificationCount(count: number) { + if (this.notificationCount === count) return; super.setNotificationCount(count); // this sometimes throws because electron is made of fail: // https://github.com/electron/electron/issues/7351 diff --git a/src/vector/platform/WebPlatform.js b/src/vector/platform/WebPlatform.js index 2029822b..bf417513 100644 --- a/src/vector/platform/WebPlatform.js +++ b/src/vector/platform/WebPlatform.js @@ -60,11 +60,13 @@ export default class WebPlatform extends VectorBasePlatform { } setNotificationCount(count: number) { + if (this.notificationCount === count) return; super.setNotificationCount(count); this._updateFavicon(); } setErrorStatus(errorDidOccur: boolean) { + if (this.errorDidOccur === errorDidOccur) return; super.setErrorStatus(errorDidOccur); this._updateFavicon(); }