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
27
src/main.ts
27
src/main.ts
|
|
@ -12,6 +12,16 @@ import { BUILD_URL, createMainWindow, mainWindow } from "./native/window";
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import * as path from "path";
|
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) {
|
if (started) {
|
||||||
app.quit();
|
app.quit();
|
||||||
}
|
}
|
||||||
|
|
@ -60,7 +70,15 @@ if (acquiredLock) {
|
||||||
updateElectronApp({ onNotifyUser });
|
updateElectronApp({ onNotifyUser });
|
||||||
|
|
||||||
app.on("ready", () => {
|
app.on("ready", () => {
|
||||||
|
applyAppName();
|
||||||
createMainWindow();
|
createMainWindow();
|
||||||
|
if (mainWindow) {
|
||||||
|
mainWindow.setTitle("AviaClient");
|
||||||
|
mainWindow.on("page-title-updated", (e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
mainWindow.setTitle("AviaClient");
|
||||||
|
});
|
||||||
|
}
|
||||||
loadInject();
|
loadInject();
|
||||||
|
|
||||||
if (config.firstLaunch) {
|
if (config.firstLaunch) {
|
||||||
|
|
@ -74,7 +92,7 @@ if (acquiredLock) {
|
||||||
initDiscordRpc();
|
initDiscordRpc();
|
||||||
|
|
||||||
if (process.platform === "win32") {
|
if (process.platform === "win32") {
|
||||||
app.setAppUserModelId("chat.stoat.notifications");
|
app.setAppUserModelId("AviaClient");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -93,6 +111,13 @@ if (acquiredLock) {
|
||||||
app.on("activate", () => {
|
app.on("activate", () => {
|
||||||
if (BrowserWindow.getAllWindows().length === 0) {
|
if (BrowserWindow.getAllWindows().length === 0) {
|
||||||
createMainWindow();
|
createMainWindow();
|
||||||
|
if (mainWindow) {
|
||||||
|
mainWindow.setTitle("AviaClient");
|
||||||
|
mainWindow.on("page-title-updated", (e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
mainWindow.setTitle("AviaClient");
|
||||||
|
});
|
||||||
|
}
|
||||||
loadInject();
|
loadInject();
|
||||||
} else {
|
} else {
|
||||||
mainWindow.show();
|
mainWindow.show();
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue