[MM-20156] Added '99+' message badge for Windows when over 99 mentions are included (#1113)

This commit is contained in:
Devin Binnie
2019-12-11 09:30:20 -05:00
committed by GitHub
parent f6aec188ce
commit a46e3f4342
2 changed files with 3 additions and 3 deletions

View File

@@ -69,7 +69,7 @@ function showBadgeWindows(sessionExpired, unreadCount, mentionCount) {
const dataURL = createBadgeDataURL('•');
sendBadge(dataURL, 'Session Expired: Please sign in to continue receiving notifications.');
} else if (mentionCount > 0) {
const dataURL = createBadgeDataURL(mentionCount.toString());
const dataURL = createBadgeDataURL((mentionCount > 99) ? '99+' : mentionCount.toString(), mentionCount > 99);
sendBadge(dataURL, 'You have unread mentions (' + mentionCount + ')');
} else if (unreadCount > 0 && config.showUnreadBadge) {
const dataURL = createBadgeDataURL('•');

View File

@@ -3,9 +3,9 @@
// See LICENSE.txt for license information.
'use strict';
export function createDataURL(text) {
export function createDataURL(text, small) {
const scale = 2; // should rely display dpi
const size = 16 * scale;
const size = (small ? 20 : 16) * scale;
const canvas = document.createElement('canvas');
canvas.setAttribute('width', size);
canvas.setAttribute('height', size);