diff --git a/src/main/views/MattermostView.ts b/src/main/views/MattermostView.ts index 93c81752..a04ff1d2 100644 --- a/src/main/views/MattermostView.ts +++ b/src/main/views/MattermostView.ts @@ -56,7 +56,6 @@ export class MattermostView extends EventEmitter { */ usesAsteriskForUnreads?: boolean; - faviconMemoize: Map; currentFavicon?: string; isInitialized: boolean; hasBeenShown: boolean; @@ -89,7 +88,6 @@ export class MattermostView extends EventEmitter { this.view = new BrowserView(this.options); this.resetLoadingStatus(); - this.faviconMemoize = new Map(); log.info(`BrowserView created for server ${this.tab.name}`); this.isInitialized = false; @@ -339,11 +337,7 @@ export class MattermostView extends EventEmitter { // if unread state is stored for that favicon, retrieve value. // if not, get related info from preload and store it for future changes this.currentFavicon = favicons[0]; - if (this.faviconMemoize.has(favicons[0])) { - appState.updateUnreads(this.tab.name, Boolean(this.faviconMemoize.get(favicons[0]))); - } else { - this.findUnreadState(favicons[0]); - } + this.findUnreadState(favicons[0]); } } @@ -361,12 +355,7 @@ export class MattermostView extends EventEmitter { // so don't memoize as we don't have the favicons and there is no rush to find out. handleFaviconIsUnread = (e: Event, favicon: string, viewName: string, result: boolean) => { if (this.tab && viewName === this.tab.name) { - if (favicon) { - this.faviconMemoize.set(favicon, result); - } - if (!favicon || favicon === this.currentFavicon) { - appState.updateUnreads(viewName, result); - } + appState.updateUnreads(viewName, result); } } }