From 7c1fa2c78d2dca7cddaa8fada1b3aafd90d24d8d Mon Sep 17 00:00:00 2001 From: Devin Binnie <52460000+devinbinnie@users.noreply.github.com> Date: Thu, 31 Mar 2022 16:46:23 -0400 Subject: [PATCH] [MM-42098] Remove icon from Windows 10/11 notification (#2032) --- src/main/notifications/Download.ts | 7 ++++--- src/main/notifications/Mention.ts | 4 ++-- src/renderer/components/SettingsPage.tsx | 1 - 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/notifications/Download.ts b/src/main/notifications/Download.ts index b1df75aa..144eeb0a 100644 --- a/src/main/notifications/Download.ts +++ b/src/main/notifications/Download.ts @@ -1,9 +1,12 @@ // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import os from 'os'; import path from 'path'; import {app, Notification} from 'electron'; +import Utils from 'common/utils/util'; + const assetsDir = path.resolve(app.getAppPath(), 'assets'); const appIconURL = path.resolve(assetsDir, 'appicon_48.png'); @@ -18,9 +21,7 @@ const defaultOptions = { export class DownloadNotification extends Notification { constructor(fileName: string, serverName: string) { const options = {...defaultOptions}; - if (process.platform === 'win32') { - options.icon = appIconURL; - } else if (process.platform === 'darwin') { + if (process.platform === 'darwin' || (process.platform === 'win32' && Utils.isVersionGreaterThanOrEqualTo(os.release(), '10.0'))) { // Notification Center shows app's icon, so there were two icons on the notification. Reflect.deleteProperty(options, 'icon'); } diff --git a/src/main/notifications/Mention.ts b/src/main/notifications/Mention.ts index f8636ef2..4c14ce07 100644 --- a/src/main/notifications/Mention.ts +++ b/src/main/notifications/Mention.ts @@ -28,11 +28,11 @@ export class Mention extends Notification { constructor(customOptions: MentionOptions, channel: {id: string}, teamId: string) { const options = {...defaultOptions, ...customOptions}; - if (process.platform === 'darwin') { + if (process.platform === 'darwin' || (process.platform === 'win32' && Utils.isVersionGreaterThanOrEqualTo(os.release(), '10.0'))) { // Notification Center shows app's icon, so there were two icons on the notification. Reflect.deleteProperty(options, 'icon'); } - const isWin7 = (process.platform === 'win32' && !Utils.isVersionGreaterThanOrEqualTo(os.version(), '6.3') && DEFAULT_WIN7); + const isWin7 = (process.platform === 'win32' && !Utils.isVersionGreaterThanOrEqualTo(os.release(), '6.3') && DEFAULT_WIN7); const customSound = String(!options.silent && ((options.data && options.data.soundName !== 'None' && options.data.soundName) || isWin7)); if (customSound) { options.silent = true; diff --git a/src/renderer/components/SettingsPage.tsx b/src/renderer/components/SettingsPage.tsx index 86fb8940..642befc9 100644 --- a/src/renderer/components/SettingsPage.tsx +++ b/src/renderer/components/SettingsPage.tsx @@ -71,7 +71,6 @@ export default class SettingsPage extends React.PureComponent; autoCheckForUpdatesRef: React.RefObject; - saveQueue: SaveQueueItem[]; selectedSpellCheckerLocales: Array<{label: string; value: string}>;