Skip to content

Commit

Permalink
chore: Update tray icons for logged-out status
Browse files Browse the repository at this point in the history
  • Loading branch information
mohandast52 committed Aug 2, 2024
1 parent 0557ae3 commit 057846b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
14 changes: 11 additions & 3 deletions electron/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,25 +131,33 @@ 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);

break;
}
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;
Expand Down
6 changes: 5 additions & 1 deletion frontend/types/ElectronApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

0 comments on commit 057846b

Please sign in to comment.