mirror of
https://github.com/agam778/MS-365-Electron.git
synced 2026-02-17 09:02:10 +00:00
Switch to checkbox type for "Enable Discord RPC" option
This commit is contained in:
59
main.js
59
main.js
@@ -267,39 +267,36 @@ const menulayout = [
|
||||
{ type: "separator" },
|
||||
{
|
||||
label: "Enable Discord Rich Presence",
|
||||
type: "radio",
|
||||
type: "checkbox",
|
||||
click: () => {
|
||||
store.set("discordrpcstatus", "true");
|
||||
dialog.showMessageBoxSync({
|
||||
type: "info",
|
||||
title: "Discord Rich Presence",
|
||||
message: "Discord Rich Presence is now enabled.",
|
||||
buttons: ["OK"],
|
||||
});
|
||||
discordrpcupdate(
|
||||
`On "${BrowserWindow.getFocusedWindow().webContents.getTitle()}"`
|
||||
);
|
||||
if (store.get("discordrpcstatus") === "true") {
|
||||
store.set("discordrpcstatus", "false");
|
||||
dialog.showMessageBoxSync({
|
||||
type: "info",
|
||||
title: "Discord Rich Presence",
|
||||
message: "Discord Rich Presence is now disabled.",
|
||||
buttons: ["OK"],
|
||||
});
|
||||
discordrpcupdate("On MS 365 Electron");
|
||||
return;
|
||||
} else if (
|
||||
store.get("discordrpcstatus") === "false" ||
|
||||
!store.get("discordrpcstatus")
|
||||
) {
|
||||
store.set("discordrpcstatus", "true");
|
||||
dialog.showMessageBoxSync({
|
||||
type: "info",
|
||||
title: "Discord Rich Presence",
|
||||
message: "Discord Rich Presence is now enabled.",
|
||||
buttons: ["OK"],
|
||||
});
|
||||
discordrpcupdate(
|
||||
`On "${BrowserWindow.getFocusedWindow().webContents.getTitle()}"`
|
||||
);
|
||||
return;
|
||||
}
|
||||
},
|
||||
checked: store.get("discordrpcstatus")
|
||||
? store.get("discordrpcstatus") === "true"
|
||||
: true,
|
||||
},
|
||||
{
|
||||
label: "Disable Discord Rich Presence",
|
||||
type: "radio",
|
||||
click: () => {
|
||||
store.set("discordrpcstatus", "false");
|
||||
dialog.showMessageBoxSync({
|
||||
type: "info",
|
||||
title: "Discord Rich Presence",
|
||||
message: "Discord Rich Presence is now disabled.",
|
||||
buttons: ["OK"],
|
||||
});
|
||||
rpc.clearActivity();
|
||||
},
|
||||
checked: store.get("discordrpcstatus")
|
||||
? store.get("discordrpcstatus") === "false"
|
||||
: false,
|
||||
checked: store.get("discordrpcstatus") === "true",
|
||||
},
|
||||
{ type: "separator" },
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user