From 715a27d7f434ee86f31bab3c9bd9665ac3cc9df0 Mon Sep 17 00:00:00 2001 From: Hasan Can Date: Thu, 2 Nov 2023 00:33:52 +0300 Subject: [PATCH] customize taskbar icon depending to session --- src/main/badge.test.js | 8 ++++---- src/main/badge.ts | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/badge.test.js b/src/main/badge.test.js index 6ca69787493..2ffe0d06d14 100644 --- a/src/main/badge.test.js +++ b/src/main/badge.test.js @@ -54,10 +54,10 @@ describe('main/badge', () => { jest.clearAllMocks(); }); - it('should show dot when session expired', async () => { + it('should show exclamation when session expired', async () => { Badge.showBadgeWindows(true, 0, false); await promise; - expect(window.setOverlayIcon).toBeCalledWith(expect.stringContaining('window.drawBadge(\'•\', false)'), expect.any(String)); + expect(window.setOverlayIcon).toBeCalledWith(expect.stringContaining('window.drawBadge(\'!\', false)'), expect.any(String)); }); it('should show mention count when has mention count', async () => { @@ -95,9 +95,9 @@ describe('main/badge', () => { jest.clearAllMocks(); }); - it('should show dot when session expired', () => { + it('should show exclamation when session expired', () => { Badge.showBadgeOSX(true, 0, false); - expect(app.dock.setBadge).toBeCalledWith('•'); + expect(app.dock.setBadge).toBeCalledWith('!'); }); it('should show mention count when has mention count', () => { diff --git a/src/main/badge.ts b/src/main/badge.ts index 5a838aeb45b..ddf82490e17 100644 --- a/src/main/badge.ts +++ b/src/main/badge.ts @@ -85,7 +85,7 @@ export function showBadgeWindows(sessionExpired: boolean, mentionCount: number, text = '•'; description = localizeMessage('main.badge.unreadChannels', 'You have unread channels'); } else if (sessionExpired) { - text = '•'; + text = '!'; description = localizeMessage('main.badge.sessionExpired', 'Session Expired: Please sign in to continue receiving notifications.'); } setOverlayIcon(text, description, mentionCount > 99); @@ -98,7 +98,7 @@ export function showBadgeOSX(sessionExpired: boolean, mentionCount: number, show } else if (showUnreadBadge && showUnreadBadgeSetting) { badge = '•'; } else if (sessionExpired) { - badge = '•'; + badge = '!'; } app.dock.setBadge(badge); }