Check if discord rpc option is enabled when a website loads or when the app is closed

This commit is contained in:
Agampreet Singh
2023-02-16 15:38:22 +05:30
parent 5b54bca522
commit 11adc6e819

View File

@@ -546,7 +546,9 @@ function createWindow() {
win.webContents.on("did-finish-load", () => {
splash.destroy();
win.show();
if (store.get("discordrpcstatus") === "true") {
discordrpc(`On "${win.webContents.getTitle()}"`);
}
});
}
@@ -564,7 +566,9 @@ app.on("web-contents-created", (event, contents) => {
});
app.on("window-all-closed", () => {
if (store.get("discordrpcstatus") === "true") {
rpc.clearActivity();
}
if (process.platform !== "darwin") {
app.quit();
}