Windows: correctly set notifications name - not electron.app.YOURAPPNAME (PR #1394)

This sets the name correctly for Windows notifications.
Currently, notifications name shows as `electron.app.YOURAPPNAME`
This commit is contained in:
Simon Smith 2022-04-21 13:54:36 +01:00 committed by GitHub
parent 60035a8e74
commit 513b9dc93d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -20,7 +20,7 @@ import {
APP_ARGS_FILE_PATH,
} from './components/mainWindow';
import { createTrayIcon } from './components/trayIcon';
import { isOSX, removeUserAgentSpecifics } from './helpers/helpers';
import { isOSX, isWindows, removeUserAgentSpecifics } from './helpers/helpers';
import { inferFlashPath } from './helpers/inferFlash';
import * as log from './helpers/loggingHelper';
import {
@ -78,6 +78,13 @@ if (!appArgs.userAgentHonest) {
}
}
// this step is required to allow app names to be displayed correctly in notifications on windows
// https://www.electronjs.org/docs/latest/api/app#appsetappusermodelidid-windows
// https://www.electronjs.org/docs/latest/tutorial/notifications#windows
if (isWindows()) {
app.setAppUserModelId(app.getName());
}
// Take in a URL on the command line as an override
if (process.argv.length > 1) {
const maybeUrl = process.argv[1];