From a774c879d4cf08a76fc404771883807d27465265 Mon Sep 17 00:00:00 2001 From: MCMXC <16797721+mcmxcdev@users.noreply.github.com> Date: Thu, 7 Dec 2023 22:37:37 -0700 Subject: refactor: code cleanup (#1476) - auto update `settings.json` due to new vscode version - replace deprecated `e.keyCode` with `e.key` - fix various code snippets with sonarlint and other lint plugins --- src/lib/Tray.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/lib') diff --git a/src/lib/Tray.ts b/src/lib/Tray.ts index c8f113346..d83f91478 100644 --- a/src/lib/Tray.ts +++ b/src/lib/Tray.ts @@ -153,16 +153,13 @@ export default class TrayIcon { _toggleWindow(): void { const [mainWindow] = BrowserWindow.getAllWindows(); - if (!mainWindow) { - return; - } if (mainWindow.isMinimized()) { mainWindow.restore(); } else if (mainWindow.isVisible() && mainWindow.isFocused()) { if (isMac && mainWindow.isFullScreen()) { - mainWindow.once('show', () => mainWindow?.setFullScreen(true)); - mainWindow.once('leave-full-screen', () => mainWindow?.hide()); + mainWindow.once('show', () => mainWindow.setFullScreen(true)); + mainWindow.once('leave-full-screen', () => mainWindow.hide()); mainWindow.setFullScreen(false); } else { mainWindow.hide(); -- cgit v1.2.3-70-g09d2