Upgrade electron to 29.1.5 and revert windows badge fix

This commit is contained in:
ayumi-signal 2024-03-20 14:56:29 -07:00 committed by GitHub
parent 703d5a97e3
commit 0f49d0d391
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 13 additions and 74 deletions

View file

@ -591,6 +591,14 @@
"messageformat": "This group is invalid. Please create a new group.",
"description": "Displayed when a user can't send a message because something has gone wrong in the conversation."
},
"icu:taskbarMarkedUnread": {
"messageformat": "Marked Unread",
"description": "(Deleted 2024/03/20) On Windows, description for screen readers for the OS taskbar icon's overlay badge when the user has marked chat(s) as unread."
},
"icu:taskbarUnreadMessages": {
"messageformat": "{count, plural, one {# Unread Message} other {# Unread Messages}}",
"description": "(Deleted 2024/03/20) On Windows, description for screen readers for the OS taskbar icon's overlay badge when there are unread messages."
},
"icu:scrollDown": {
"messageformat": "Scroll to bottom of chat",
"description": "Alt text for button to take user down to bottom of conversation, shown when user scrolls up"
@ -611,14 +619,6 @@
"messageformat": "{count, plural, one {# Unread Message} other {# Unread Messages}}",
"description": "Text for unread message separator, with count"
},
"icu:taskbarMarkedUnread": {
"messageformat": "Marked Unread",
"description": "On Windows, description for screen readers for the OS taskbar icon's overlay badge when the user has marked chat(s) as unread."
},
"icu:taskbarUnreadMessages": {
"messageformat": "{count, plural, one {# Unread Message} other {# Unread Messages}}",
"description": "On Windows, description for screen readers for the OS taskbar icon's overlay badge when there are unread messages."
},
"icu:messageHistoryUnsynced": {
"messageformat": "For your security, chat history isn't transferred to new linked devices.",
"description": "Shown in the conversation history when a user links a new device to explain what is not supported."

View file

@ -117,7 +117,6 @@ import type { ParsedSignalRoute } from '../ts/util/signalRoutes';
import { parseSignalRoute } from '../ts/util/signalRoutes';
import * as dns from '../ts/util/dns';
import { ZoomFactorService } from '../ts/services/ZoomFactorService';
import { getMarkedUnreadIcon, getUnreadIcon } from '../ts/util/unreadIcon';
const STICKER_CREATOR_PARTITION = 'sticker-creator';
@ -2269,44 +2268,10 @@ ipc.on(
if (process.platform === 'darwin') {
// Will show a ● on macOS when undefined
app.setBadgeCount(undefined);
} else if (process.platform === 'win32') {
// setBadgeCount is unsupported on Windows, so we use setOverlayIcon
let description;
try {
description = getResolvedMessagesLocale().i18n(
'icu:taskbarMarkedUnread'
);
} catch {
description = 'Unread';
}
mainWindow?.setOverlayIcon(getMarkedUnreadIcon(), description);
} else {
// All other OS's need a number
app.setBadgeCount(1);
}
return;
}
if (process.platform === 'win32') {
if (!mainWindow) {
return;
}
let description;
try {
description = getResolvedMessagesLocale().i18n(
'icu:taskbarUnreadMessages',
{ count: badge }
);
} catch {
description = String(badge);
}
if (badge === 0) {
mainWindow.setOverlayIcon(null, '');
} else {
mainWindow.setOverlayIcon(getUnreadIcon(badge), description);
}
} else {
app.setBadgeCount(badge);
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 437 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 533 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 562 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 497 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 543 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 571 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 445 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 570 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 604 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 575 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 325 B

View file

@ -288,7 +288,7 @@
"csv-parse": "5.5.2",
"danger": "11.1.2",
"debug": "4.3.3",
"electron": "29.1.0",
"electron": "29.1.5",
"electron-builder": "24.6.3",
"electron-mocha": "12.2.0",
"endanger": "7.0.4",

View file

@ -1,26 +0,0 @@
// Copyright 2024 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { join } from 'path';
import type { NativeImage } from 'electron';
import { nativeImage } from 'electron';
export function getUnreadIcon(unreadCount: number): NativeImage {
const filename =
unreadCount > 9 ? '9-plus.png' : `${String(unreadCount)}.png`;
const path = join(__dirname, '..', '..', 'images', 'unread-icon', filename);
// if path does not exist, this returns an empty NativeImage
return nativeImage.createFromPath(path);
}
export function getMarkedUnreadIcon(): NativeImage {
const path = join(
__dirname,
'..',
'..',
'images',
'unread-icon',
'marked-unread.png'
);
return nativeImage.createFromPath(path);
}

View file

@ -9205,10 +9205,10 @@ electron-window@^0.8.0:
dependencies:
is-electron-renderer "^2.0.0"
electron@29.1.0:
version "29.1.0"
resolved "https://registry.yarnpkg.com/electron/-/electron-29.1.0.tgz#37f0e4915226db3c87bc54b187795272bf61fc39"
integrity sha512-giJVIm0sWVp+8V1GXrKqKTb+h7no0P3ooYqEd34AD9wMJzGnAeL+usj+R0155/0pdvvP1mgydnA7lcaFA2M9lw==
electron@29.1.5:
version "29.1.5"
resolved "https://registry.yarnpkg.com/electron/-/electron-29.1.5.tgz#b745b4d201c1ac9f84d6aa034126288dde34d5a1"
integrity sha512-1uWGRw/ffA62lcrklxGUgVxVtOHojsg/nwsYr+/F9cVjipZJn8iPv/ABGIIexhmUqWcho8BqfTJ4osCBa29gBg==
dependencies:
"@electron/get" "^2.0.0"
"@types/node" "^20.9.0"