File tree Expand file tree Collapse file tree 5 files changed +8
-12
lines changed Expand file tree Collapse file tree 5 files changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,7 @@ menubarApp.on('ready', () => {
67
67
} ) ;
68
68
69
69
ipcMain . on ( 'reopen-window' , ( ) => menubarApp . showWindow ( ) ) ;
70
+ ipcMain . on ( 'hide-window' , ( ) => menubarApp . hideWindow ( ) ) ;
70
71
ipcMain . on ( 'app-quit' , ( ) => menubarApp . app . quit ( ) ) ;
71
72
ipcMain . on ( 'update-icon' , ( _ , arg ) => {
72
73
if ( ! menubarApp . tray . isDestroyed ( ) ) {
Original file line number Diff line number Diff line change 1
- import { generateGitHubAPIUrl } from './helpers' ;
2
-
3
- const { BrowserWindow } = require ( '@electron/remote' ) ;
1
+ import { BrowserWindow } from '@electron/remote' ;
4
2
3
+ import { generateGitHubAPIUrl } from './helpers' ;
5
4
import { apiRequest , apiRequestAuth } from '../utils/api-requests' ;
6
5
import { AuthResponse , AuthState , AuthTokenResponse } from '../types' ;
7
6
import { Constants } from '../utils/constants' ;
Original file line number Diff line number Diff line change
1
+ import { ipcRenderer , shell } from 'electron' ;
2
+ import remote from '@electron/remote' ;
1
3
import {
2
4
updateTrayIcon ,
3
5
openExternalLink ,
4
6
setAutoLaunch ,
5
7
restoreSetting ,
6
8
} from './comms' ;
7
9
8
- const { ipcRenderer, shell } = require ( 'electron' ) ;
9
-
10
- const remote = require ( '@electron/remote' ) ;
11
-
12
10
describe ( 'utils/comms.ts' , ( ) => {
13
11
beforeEach ( function ( ) {
14
12
jest . spyOn ( ipcRenderer , 'send' ) ;
Original file line number Diff line number Diff line change 1
- const { ipcRenderer, shell } = require ( 'electron' ) ;
2
- const remote = require ( '@electron/remote' ) ;
1
+ import { ipcRenderer , shell } from 'electron' ;
2
+ import remote from '@electron/remote' ;
3
3
4
4
export function openExternalLink ( url : string ) : void {
5
5
shell . openExternal ( url ) ;
Original file line number Diff line number Diff line change 1
1
import { ipcRenderer } from 'electron' ;
2
- const remote = require ( '@electron/remote' ) ;
3
-
4
2
import { openInBrowser } from '../utils/helpers' ;
5
3
import { updateTrayIcon } from './comms' ;
6
4
import { Notification } from '../typesGithub' ;
@@ -84,7 +82,7 @@ export const raiseNativeNotification = (
84
82
85
83
nativeNotification . onclick = function ( ) {
86
84
if ( notifications . length === 1 ) {
87
- remote . getCurrentWindow ( ) . hide ( ) ;
85
+ ipcRenderer . send ( ' hide-window' ) ;
88
86
openInBrowser ( notifications [ 0 ] , accounts ) ;
89
87
} else {
90
88
ipcRenderer . send ( 'reopen-window' ) ;
You can’t perform that action at this time.
0 commit comments