@@ -6,6 +6,7 @@ const logger = require('./common/logger')
6
6
const store = require ( './common/store' )
7
7
const moveRepositoryLocation = require ( './move-repository-location' )
8
8
const runGarbageCollector = require ( './run-gc' )
9
+ const ipcMainEvents = require ( './common/ipc-main-events' )
9
10
const { setCustomBinary, clearCustomBinary, hasCustomBinary } = require ( './custom-ipfs-binary' )
10
11
const { STATUS } = require ( './daemon' )
11
12
const { IS_MAC , IS_WIN , VERSION , GO_IPFS_VERSION } = require ( './common/consts' )
@@ -19,7 +20,7 @@ function buildCheckbox (key, label) {
19
20
return {
20
21
id : key ,
21
22
label : i18n . t ( label ) ,
22
- click : ( ) => { ipcMain . emit ( `toggle_ ${ key } ` ) } ,
23
+ click : ( ) => { ipcMain . emit ( ipcMainEvents . TOGGLE ( key ) ) } ,
23
24
type : 'checkbox' ,
24
25
checked : false
25
26
}
@@ -261,8 +262,8 @@ module.exports = function (ctx) {
261
262
tray . setContextMenu ( menu )
262
263
tray . setToolTip ( 'IPFS Desktop' )
263
264
264
- menu . on ( 'menu-will-show' , ( ) => { ipcMain . emit ( 'menubar-will-open' ) } )
265
- menu . on ( 'menu-will-close' , ( ) => { ipcMain . emit ( 'menubar-will-close' ) } )
265
+ menu . on ( 'menu-will-show' , ( ) => { ipcMain . emit ( ipcMainEvents . MENUBAR_OPEN ) } )
266
+ menu . on ( 'menu-will-close' , ( ) => { ipcMain . emit ( ipcMainEvents . MENUBAR_CLOSE ) } )
266
267
267
268
updateMenu ( )
268
269
}
0 commit comments