Make the title more like in the official client (#404)

This commit is contained in:
Davilarek 2023-06-10 19:31:14 +02:00 committed by GitHub
parent 08209c2865
commit 52e5522f11
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -172,6 +172,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.split(" | ")[1] ?? title) + armCordSuffix}'`
);
}
});
}
const userDataPath = app.getPath("userData");
const themesFolder = `${userDataPath}/themes/`;