[MM-42098] Remove icon from Windows 10/11 notification (#2032)
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
@@ -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;
|
||||
|
@@ -71,7 +71,6 @@ export default class SettingsPage extends React.PureComponent<Record<string, nev
|
||||
startInFullscreenRef: React.RefObject<HTMLInputElement>;
|
||||
autoCheckForUpdatesRef: React.RefObject<HTMLInputElement>;
|
||||
|
||||
|
||||
saveQueue: SaveQueueItem[];
|
||||
|
||||
selectedSpellCheckerLocales: Array<{label: string; value: string}>;
|
||||
|
Reference in New Issue
Block a user