[MM-52984] Fix minimized window not showing when clicking the notification (#2745)

* Fix minimized window not showing when clicking the notification

* Fix tests
This commit is contained in:
Devin Binnie 2023-06-01 13:01:27 -04:00 committed by GitHub
parent 90b4489053
commit 1db2828a93
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View file

@ -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');
});

View file

@ -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});