Update OldTitleBar.plugin.js
This commit is contained in:
parent
4680313272
commit
1d9b9222e9
|
@ -2,7 +2,7 @@
|
||||||
* @name OldTitleBar
|
* @name OldTitleBar
|
||||||
* @author DevilBro
|
* @author DevilBro
|
||||||
* @authorId 278543574059057154
|
* @authorId 278543574059057154
|
||||||
* @version 1.7.5
|
* @version 1.7.6
|
||||||
* @description Allows you to switch to Discord's old Titlebar
|
* @description Allows you to switch to Discord's old Titlebar
|
||||||
* @invite Jx3TjNS
|
* @invite Jx3TjNS
|
||||||
* @donate https://www.paypal.me/MircoWittrien
|
* @donate https://www.paypal.me/MircoWittrien
|
||||||
|
@ -127,16 +127,14 @@ module.exports = (_ => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
this.patchedModules = {
|
this.modulePatches = {
|
||||||
before: {
|
before: [
|
||||||
HeaderBar: "default"
|
"HeaderBar"
|
||||||
},
|
],
|
||||||
after: {
|
after: [
|
||||||
App: "render",
|
"AuthWrapper",
|
||||||
AppSkeleton: "render",
|
"StandardSidebarView"
|
||||||
StandardSidebarView: "default",
|
]
|
||||||
AuthWrapper: "render"
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
this.css = `
|
this.css = `
|
||||||
|
@ -241,15 +239,6 @@ module.exports = (_ => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
processApp (e) {
|
|
||||||
let [children, index] = BDFDB.ReactUtils.findParent(e.instance, {props: [["type", ["WINDOWS", "MACOS"]]]});
|
|
||||||
if (index > -1) children[index] = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
processAppSkeleton (e) {
|
|
||||||
this.processApp(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
processHeaderBar (e) {
|
processHeaderBar (e) {
|
||||||
let wrapper = BDFDB.ReactUtils.findChild(e.instance, {props: ["toolbar", "children"]});
|
let wrapper = BDFDB.ReactUtils.findChild(e.instance, {props: ["toolbar", "children"]});
|
||||||
if (!wrapper) return;
|
if (!wrapper) return;
|
||||||
|
@ -264,6 +253,11 @@ module.exports = (_ => {
|
||||||
this.injectButtons(children, true);
|
this.injectButtons(children, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
processAuthWrapper (e) {
|
||||||
|
if (!BDFDB.ArrayUtils.is(e.returnvalue.props.children)) e.returnvalue.props.children = [e.returnvalue.props.children];
|
||||||
|
this.injectSettingsToolbar(e.returnvalue.props.children, true);
|
||||||
|
}
|
||||||
|
|
||||||
processStandardSidebarView (e) {
|
processStandardSidebarView (e) {
|
||||||
let sidebarView = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.settingswindowstandardsidebarview]]});
|
let sidebarView = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.settingswindowstandardsidebarview]]});
|
||||||
if (!sidebarView) return;
|
if (!sidebarView) return;
|
||||||
|
@ -271,11 +265,6 @@ module.exports = (_ => {
|
||||||
this.injectSettingsToolbar(sidebarView.props.children);
|
this.injectSettingsToolbar(sidebarView.props.children);
|
||||||
}
|
}
|
||||||
|
|
||||||
processAuthWrapper (e) {
|
|
||||||
if (!BDFDB.ArrayUtils.is(e.returnvalue.props.children)) e.returnvalue.props.children = [e.returnvalue.props.children];
|
|
||||||
this.injectSettingsToolbar(e.returnvalue.props.children, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
injectSettingsToolbar (children, fixed) {
|
injectSettingsToolbar (children, fixed) {
|
||||||
if (!this.settings.general.addToSettings) return;
|
if (!this.settings.general.addToSettings) return;
|
||||||
let toolbar = BDFDB.ReactUtils.createElement("div", {
|
let toolbar = BDFDB.ReactUtils.createElement("div", {
|
||||||
|
|
Loading…
Reference in New Issue