Skip to content

Commit

Permalink
fix: window title fix
Browse files Browse the repository at this point in the history
  • Loading branch information
smartfrigde committed Apr 29, 2024
1 parent 052ef80 commit a532cb9
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,17 +177,16 @@ async function doAfterDefiningTheWindow(): Promise<void> {
mainWindow.setIcon(trayPath);
}
});

mainWindow.webContents.on("page-title-updated", async (e, title) => {
const armCordSuffix = " - ArmCord"; /* identify */
if (!title.endsWith(armCordSuffix)) {
e.preventDefault();
await mainWindow.webContents.executeJavaScript(
`document.title = '${title.replace("Discord |", "") + armCordSuffix}'`
);
}
});
}
mainWindow.webContents.on("page-title-updated", async (e, title) => {
const armCordSuffix = " - ArmCord"; /* identify */
if (!title.endsWith(armCordSuffix)) {
e.preventDefault();
await mainWindow.webContents.executeJavaScript(
`document.title = '${title.replace("Discord |", "") + armCordSuffix}'`
);
}
});
const userDataPath = app.getPath("userData");
const themesFolder = `${userDataPath}/themes/`;
if (!fs.existsSync(themesFolder)) {
Expand Down

0 comments on commit a532cb9

Please sign in to comment.