[MM-20156] Added '99+' message badge for Windows when over 99 mentions are included (#1113)
This commit is contained in:
@@ -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('•');
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user