From 057846b3df83549b8176822aa307b908ff106b2e Mon Sep 17 00:00:00 2001 From: mohandast52 Date: Fri, 2 Aug 2024 19:00:27 +0530 Subject: [PATCH] chore: Update tray icons for logged-out status --- electron/main.js | 14 +++++++++++--- frontend/types/ElectronApi.ts | 6 +++++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/electron/main.js b/electron/main.js index e2c66a668..5a01cae73 100644 --- a/electron/main.js +++ b/electron/main.js @@ -131,17 +131,18 @@ const createTray = () => { tray.setContextMenu(contextMenu); ipcMain.on('tray', (_event, status) => { + const isSupportedOS = isWindows || isMac; switch (status) { case 'low-gas': { const icon = getUpdatedTrayIcon( - isWindows || isMac ? TRAY_ICONS.LOW_GAS : TRAY_ICONS_PATHS.LOW_GAS, + isSupportedOS ? TRAY_ICONS.LOW_GAS : TRAY_ICONS_PATHS.LOW_GAS, ); tray.setImage(icon); break; } case 'running': { const icon = getUpdatedTrayIcon( - isWindows || isMac ? TRAY_ICONS.RUNNING : TRAY_ICONS_PATHS.RUNNING, + isSupportedOS ? TRAY_ICONS.RUNNING : TRAY_ICONS_PATHS.RUNNING, ); tray.setImage(icon); @@ -149,7 +150,14 @@ const createTray = () => { } case 'paused': { const icon = getUpdatedTrayIcon( - isWindows || isMac ? TRAY_ICONS.PAUSED : TRAY_ICONS_PATHS.PAUSED, + isSupportedOS ? TRAY_ICONS.PAUSED : TRAY_ICONS_PATHS.PAUSED, + ); + tray.setImage(icon); + break; + } + case 'logged-out': { + const icon = getUpdatedTrayIcon( + isSupportedOS ? TRAY_ICONS.LOGGED_OUT : TRAY_ICONS_PATHS.LOGGED_OUT, ); tray.setImage(icon); break; diff --git a/frontend/types/ElectronApi.ts b/frontend/types/ElectronApi.ts index df0456a47..61d551e8b 100644 --- a/frontend/types/ElectronApi.ts +++ b/frontend/types/ElectronApi.ts @@ -6,4 +6,8 @@ export type ElectronStore = { agentEvictionAlertShown?: boolean; }; -export type ElectronTrayIconStatus = 'low-gas' | 'running' | 'paused'; +export type ElectronTrayIconStatus = + | 'low-gas' + | 'running' + | 'paused' + | 'logged-out';