Skip to content

Commit

Permalink
customize taskbar icon depending to session (#2899)
Browse files Browse the repository at this point in the history
Co-authored-by: Mattermost Build <build@mattermost.com>
  • Loading branch information
hasancankucuk and mattermost-build authored Dec 5, 2023
1 parent 794a326 commit 9f80b7d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/main/badge.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down Expand Up @@ -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', () => {
Expand Down
4 changes: 2 additions & 2 deletions src/main/badge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
}
Expand Down

0 comments on commit 9f80b7d

Please sign in to comment.