customize taskbar icon depending to session (#2899)

Co-authored-by: Mattermost Build <build@mattermost.com>
This commit is contained in:
Hasan Can 2023-12-05 19:22:53 +03:00 committed by GitHub
parent 794a326350
commit 9f80b7d82b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View file

@ -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', () => {

View file

@ -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);
}