( mb: Menubar, contextMenu: Electron.Menu, protocol: string, )
| 16 | * @param protocol - The custom protocol string (e.g. 'gitify' or 'gitify-dev'). |
| 17 | */ |
| 18 | export function initializeAppLifecycle( |
| 19 | mb: Menubar, |
| 20 | contextMenu: Electron.Menu, |
| 21 | protocol: string, |
| 22 | ): void { |
| 23 | mb.on('ready', () => { |
| 24 | mb.app.setAppUserModelId(APPLICATION.ID); |
| 25 | |
| 26 | mb.tray.setToolTip(APPLICATION.NAME); |
| 27 | |
| 28 | mb.tray.setIgnoreDoubleClickEvents(true); |
| 29 | |
| 30 | mb.tray.on('right-click', (_event, bounds) => { |
| 31 | mb.tray.popUpContextMenu(contextMenu, { x: bounds.x, y: bounds.y }); |
| 32 | }); |
| 33 | }); |
| 34 | |
| 35 | preventSecondInstance(mb, protocol); |
| 36 | } |
| 37 | |
| 38 | /** |
| 39 | * Handle a gitify:// protocol URL by forwarding it to the renderer process |
no test coverage detected