Change the windows title from Stoat to AviaClient To match upcoming updates
This commit is contained in:
parent
02f1eb08ff
commit
9db9cd9373
1 changed files with 27 additions and 2 deletions
29
src/main.ts
29
src/main.ts
|
|
@ -12,6 +12,16 @@ import { BUILD_URL, createMainWindow, mainWindow } from "./native/window";
|
|||
import * as fs from "fs";
|
||||
import * as path from "path";
|
||||
|
||||
const applyAppName = () => {
|
||||
try {
|
||||
app.setName("AviaClient");
|
||||
(app as any).name = "AviaClient";
|
||||
if (process.platform === "win32") {
|
||||
app.setAppUserModelId("AviaClient");
|
||||
}
|
||||
} catch {}
|
||||
};
|
||||
|
||||
if (started) {
|
||||
app.quit();
|
||||
}
|
||||
|
|
@ -60,7 +70,15 @@ if (acquiredLock) {
|
|||
updateElectronApp({ onNotifyUser });
|
||||
|
||||
app.on("ready", () => {
|
||||
applyAppName();
|
||||
createMainWindow();
|
||||
if (mainWindow) {
|
||||
mainWindow.setTitle("AviaClient");
|
||||
mainWindow.on("page-title-updated", (e) => {
|
||||
e.preventDefault();
|
||||
mainWindow.setTitle("AviaClient");
|
||||
});
|
||||
}
|
||||
loadInject();
|
||||
|
||||
if (config.firstLaunch) {
|
||||
|
|
@ -74,7 +92,7 @@ if (acquiredLock) {
|
|||
initDiscordRpc();
|
||||
|
||||
if (process.platform === "win32") {
|
||||
app.setAppUserModelId("chat.stoat.notifications");
|
||||
app.setAppUserModelId("AviaClient");
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -93,6 +111,13 @@ if (acquiredLock) {
|
|||
app.on("activate", () => {
|
||||
if (BrowserWindow.getAllWindows().length === 0) {
|
||||
createMainWindow();
|
||||
if (mainWindow) {
|
||||
mainWindow.setTitle("AviaClient");
|
||||
mainWindow.on("page-title-updated", (e) => {
|
||||
e.preventDefault();
|
||||
mainWindow.setTitle("AviaClient");
|
||||
});
|
||||
}
|
||||
loadInject();
|
||||
} else {
|
||||
mainWindow.show();
|
||||
|
|
@ -123,4 +148,4 @@ if (acquiredLock) {
|
|||
});
|
||||
} else {
|
||||
app.quit();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue