From 11adc6e8199d677cef1deda91aaf73fc00f33404 Mon Sep 17 00:00:00 2001 From: Agampreet Singh <68941022+agam778@users.noreply.github.com> Date: Thu, 16 Feb 2023 15:38:22 +0530 Subject: [PATCH] Check if discord rpc option is enabled when a website loads or when the app is closed --- main.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/main.js b/main.js index 54f8f35..fbc3be6 100644 --- a/main.js +++ b/main.js @@ -546,7 +546,9 @@ function createWindow() { win.webContents.on("did-finish-load", () => { splash.destroy(); win.show(); - discordrpc(`On "${win.webContents.getTitle()}"`); + 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", () => { - rpc.clearActivity(); + if (store.get("discordrpcstatus") === "true") { + rpc.clearActivity(); + } if (process.platform !== "darwin") { app.quit(); }