mirror of
https://github.com/agam778/MS-365-Electron.git
synced 2026-02-17 09:02:10 +00:00
Check if discord rpc option is enabled when a website loads or when the app is closed
This commit is contained in:
8
main.js
8
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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user