From 1db2828a9396a7e4cb116123d11de689c8c3599c Mon Sep 17 00:00:00 2001 From: Devin Binnie <52460000+devinbinnie@users.noreply.github.com> Date: Thu, 1 Jun 2023 13:01:27 -0400 Subject: [PATCH] [MM-52984] Fix minimized window not showing when clicking the notification (#2745) * Fix minimized window not showing when clicking the notification * Fix tests --- src/main/notifications/index.test.js | 2 ++ src/main/notifications/index.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/src/main/notifications/index.test.js b/src/main/notifications/index.test.js index d6a0c9a5..edfcfd69 100644 --- a/src/main/notifications/index.test.js +++ b/src/main/notifications/index.test.js @@ -86,6 +86,7 @@ jest.mock('../views/viewManager', () => ({ })); jest.mock('../windows/mainWindow', () => ({ get: jest.fn(), + show: jest.fn(), sendToRenderer: jest.fn(), })); @@ -244,6 +245,7 @@ describe('main/notifications', () => { ); const mention = mentions.find((m) => m.body === 'mention_click_body'); mention.value.click(); + expect(MainWindow.show).toHaveBeenCalled(); expect(ViewManager.showById).toHaveBeenCalledWith('server_id'); }); diff --git a/src/main/notifications/index.ts b/src/main/notifications/index.ts index 34134f4f..210c9723 100644 --- a/src/main/notifications/index.ts +++ b/src/main/notifications/index.ts @@ -73,6 +73,7 @@ export function displayMention(title: string, body: string, channel: {id: string mention.on('click', () => { log.debug('notification click', serverName, mention); + MainWindow.show(); if (serverName) { ViewManager.showById(view.id); webcontents.send('notification-clicked', {channel, teamId, url});