From 9f80b7d82b79a55b82e9c26dad2cf97e0f3977ec Mon Sep 17 00:00:00 2001 From: Hasan Can <62356575+hasancankucuk@users.noreply.github.com> Date: Tue, 5 Dec 2023 19:22:53 +0300 Subject: [PATCH] customize taskbar icon depending to session (#2899) Co-authored-by: Mattermost Build --- 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 6ca69787..2ffe0d06 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 5a838aeb..ddf82490 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); }