diff options
Diffstat (limited to 'src/electron/ipc-api/appIndicator.ts')
-rw-r--r-- | src/electron/ipc-api/appIndicator.ts | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/electron/ipc-api/appIndicator.ts b/src/electron/ipc-api/appIndicator.ts index bd5f6a68f..766e6937a 100644 --- a/src/electron/ipc-api/appIndicator.ts +++ b/src/electron/ipc-api/appIndicator.ts | |||
@@ -1,7 +1,8 @@ | |||
1 | import { app, ipcMain, BrowserWindow, Tray } from 'electron'; | 1 | import { app, ipcMain, BrowserWindow } from 'electron'; |
2 | import { join } from 'path'; | 2 | import { join } from 'path'; |
3 | import { autorun } from 'mobx'; | 3 | import { autorun } from 'mobx'; |
4 | import { isMac, isWindows, isLinux } from '../../environment'; | 4 | import { isMac, isWindows, isLinux } from '../../environment'; |
5 | import TrayIcon from '../../lib/Tray'; | ||
5 | 6 | ||
6 | const INDICATOR_TASKBAR = 'taskbar'; | 7 | const INDICATOR_TASKBAR = 'taskbar'; |
7 | const FILE_EXTENSION = isWindows ? 'ico' : 'png'; | 8 | const FILE_EXTENSION = isWindows ? 'ico' : 'png'; |
@@ -24,16 +25,14 @@ function getAsset(type: 'tray' | 'taskbar', asset: string) { | |||
24 | export default (params: { | 25 | export default (params: { |
25 | mainWindow: BrowserWindow; | 26 | mainWindow: BrowserWindow; |
26 | settings: any; | 27 | settings: any; |
27 | trayIcon: Tray; | 28 | trayIcon: TrayIcon; |
28 | }) => { | 29 | }) => { |
29 | autorun(() => { | 30 | autorun(() => { |
30 | isTrayIconEnabled = params.settings.app.get('enableSystemTray'); | 31 | isTrayIconEnabled = params.settings.app.get('enableSystemTray'); |
31 | 32 | ||
32 | if (!isTrayIconEnabled) { | 33 | if (!isTrayIconEnabled) { |
33 | // @ts-expect-error Property 'hide' does not exist on type 'Tray'. | ||
34 | params.trayIcon.hide(); | 34 | params.trayIcon.hide(); |
35 | } else if (isTrayIconEnabled) { | 35 | } else if (isTrayIconEnabled) { |
36 | // @ts-expect-error Property 'show' does not exist on type 'Tray'. | ||
37 | params.trayIcon.show(); | 36 | params.trayIcon.show(); |
38 | } | 37 | } |
39 | }); | 38 | }); |
@@ -87,7 +86,6 @@ export default (params: { | |||
87 | } | 86 | } |
88 | 87 | ||
89 | // Update Tray | 88 | // Update Tray |
90 | // @ts-expect-error Property 'setIndicator' does not exist on type 'Tray'. | ||
91 | params.trayIcon.setIndicator(args.indicator); | 89 | params.trayIcon.setIndicator(args.indicator); |
92 | }); | 90 | }); |
93 | }; | 91 | }; |