Skip to content

Commit 1cd043a

Browse files
author
Brendan Mulholland
committed
chore: Replace remote for hiding window
1 parent e7c7df9 commit 1cd043a

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

main.js

+1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ menubarApp.on('ready', () => {
6767
});
6868

6969
ipcMain.on('reopen-window', () => menubarApp.showWindow());
70+
ipcMain.on('hide-window', () => menubarApp.hideWindow());
7071
ipcMain.on('app-quit', () => menubarApp.app.quit());
7172
ipcMain.on('update-icon', (_, arg) => {
7273
if (!menubarApp.tray.isDestroyed()) {

src/utils/comms.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const { ipcRenderer, shell } = require('electron');
1010
const remote = require('@electron/remote');
1111

1212
describe('utils/comms.ts', () => {
13-
beforeEach(function() {
13+
beforeEach(function () {
1414
jest.spyOn(ipcRenderer, 'send');
1515
});
1616

src/utils/notifications.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,9 @@ export const raiseNativeNotification = (
6666

6767
if (notifications.length === 1) {
6868
const notification = notifications[0];
69-
title = `${process.platform !== 'win32' ? 'Gitify - ' : ''}${notification.repository.full_name
70-
}`;
69+
title = `${process.platform !== 'win32' ? 'Gitify - ' : ''}${
70+
notification.repository.full_name
71+
}`;
7172
body = notification.subject.title;
7273
} else {
7374
title = 'Gitify';
@@ -79,9 +80,9 @@ export const raiseNativeNotification = (
7980
silent: true,
8081
});
8182

82-
nativeNotification.onclick = function() {
83+
nativeNotification.onclick = function () {
8384
if (notifications.length === 1) {
84-
remote.getCurrentWindow().hide();
85+
ipcRenderer.send('hide-window');
8586
openInBrowser(notifications[0], accounts);
8687
} else {
8788
ipcRenderer.send('reopen-window');

0 commit comments

Comments
 (0)