diff --git a/Plugins/OldTitleBar/OldTitleBar.plugin.js b/Plugins/OldTitleBar/OldTitleBar.plugin.js
index 7d4ba5917f..178e11c1f4 100644
--- a/Plugins/OldTitleBar/OldTitleBar.plugin.js
+++ b/Plugins/OldTitleBar/OldTitleBar.plugin.js
@@ -65,7 +65,7 @@ module.exports = (_ => {
onLoad () {
patched = false;
- electronWindow = BDFDB.LibraryRequires.electron.remote.getCurrentWindow();
+ electronWindow = BDFDB.LibraryRequires.electron && BDFDB.LibraryRequires.electron.remote && BDFDB.LibraryRequires.electron.remote.getCurrentWindow();
this.defaults = {
settings: {
@@ -171,18 +171,17 @@ module.exports = (_ => {
onChange: isNativeTitlebarSetting ? value => {
if (this.patchMainScreen(value)) {
patched = !patched;
- document.querySelector("#OldTitleBarNotifyBar")?.close();
- if (patched) BDFDB.NotificationUtils.notice("Changed nativebar settings, relaunch to see changes:", {
- type: "danger",
- id: "OldTitleBarNotifyBar",
- buttons: [{
- contents: "Relaunch",
- onClick: _ => {
+ let notifybar = document.querySelector("#OldTitleBarNotifyBar");
+ if (notifybar) notifybar.querySelector(BDFDB.dotCN.noticedismiss).click();
+ if (patched) {
+ notifybar = BDFDB.NotificationUtils.notice("Changed nativebar settings, relaunch to see changes:", {type: "danger",btn: "Relaunch",id: "OldTitleBarNotifyBar"});
+ notifybar.querySelector(BDFDB.dotCN.noticebutton).addEventListener("click", _ => {
+ if (BDFDB.LibraryRequires.electron && BDFDB.LibraryRequires.electron.remote) {
BDFDB.LibraryRequires.electron.remote.app.relaunch();
BDFDB.LibraryRequires.electron.remote.app.quit();
}
- }]
- });
+ });
+ }
}
} : null
}));
@@ -260,7 +259,7 @@ module.exports = (_ => {
tooltipConfig: {type: "bottom"},
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Clickable, {
className: BDFDB.disCNS.channelheadericonwrapper + BDFDB.disCN.channelheadericonclickable,
- onClick: _ => {electronWindow.reload();},
+ onClick: _ => {electronWindow && electronWindow.reload();},
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, {
className: BDFDB.disCN.channelheadericon,
iconSVG: ``
@@ -271,7 +270,7 @@ module.exports = (_ => {
};
children.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Clickable, {
className: BDFDB.disCNS.channelheadericonwrapper + BDFDB.disCN.channelheadericonclickable,
- onClick: _ => {electronWindow.minimize();},
+ onClick: _ => {electronWindow && electronWindow.minimize();},
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, {
className: BDFDB.disCN.channelheadericon,
iconSVG: ``
@@ -280,7 +279,8 @@ module.exports = (_ => {
children.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Clickable, {
className: BDFDB.disCNS.channelheadericonwrapper + BDFDB.disCN.channelheadericonclickable,
onClick: _ => {
- if (electronWindow.isMaximized()) electronWindow.unmaximize();
+ if (!electronWindow) return;
+ else if (electronWindow.isMaximized()) electronWindow.unmaximize();
else electronWindow.maximize();
},
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, {
@@ -290,7 +290,7 @@ module.exports = (_ => {
}));
children.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Clickable, {
className: BDFDB.disCNS.channelheadericonwrapper + BDFDB.disCN.channelheadericonclickable,
- onClick: _ => {electronWindow.close();},
+ onClick: _ => {electronWindow && electronWindow.close();},
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, {
className: BDFDB.disCN.channelheadericon,
iconSVG: ``
diff --git a/Plugins/PluginRepo/PluginRepo.plugin.js b/Plugins/PluginRepo/PluginRepo.plugin.js
index 1c9a87479f..8b14b7d6ae 100644
--- a/Plugins/PluginRepo/PluginRepo.plugin.js
+++ b/Plugins/PluginRepo/PluginRepo.plugin.js
@@ -933,6 +933,7 @@ module.exports = (_ => {
callback();
}
});
+ if (!sandbox) callback();
});
}
diff --git a/Themes/_res/svgs/settings_icons_betterdiscord.svg b/Themes/_res/svgs/settings_icons_betterdiscord.svg
index 0fad44369e..a7e59a3e4c 100644
--- a/Themes/_res/svgs/settings_icons_betterdiscord.svg
+++ b/Themes/_res/svgs/settings_icons_betterdiscord.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file