This commit is contained in:
Mirco Wittrien 2023-03-18 12:07:50 +01:00
parent 468b1b9e13
commit 0cebcd2125
2 changed files with 10 additions and 10 deletions

View File

@ -636,13 +636,15 @@ module.exports = (_ => {
onUserSettingsCogContextMenu (e) {
BDFDB.TimeUtils.timeout(_ => {
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {props: [["label", ["BandagedBD", "BetterDiscord"]]]});
if (index > -1 && BDFDB.ArrayUtils.is(children[index].props.children)) children[index].props.children.push(BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
label: "Plugin Repo",
id: BDFDB.ContextMenuUtils.createItemId(this.name, "repo"),
action: _ => {
BDFDB.LibraryModules.UserSettingsUtils.open("pluginrepo");
}
}));
if (index > -1 && BDFDB.ArrayUtils.is(children[index].props.children)) {
let item = BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
label: "Plugin Repo",
id: BDFDB.ContextMenuUtils.createItemId(this.name, "repo"),
action: _ => BDFDB.LibraryModules.UserSettingsUtils.open("pluginrepo")
});
if (children[index].props.children.find(n => n && n.props && n.props.id == "themerepo-repo")) children[index].props.children.splice(children[index].props.children.length-1, 0, item);
else children[index].props.children.push(item);
}
});
}

View File

@ -779,9 +779,7 @@ module.exports = (_ => {
if (index > -1 && BDFDB.ArrayUtils.is(children[index].props.children)) children[index].props.children.push(BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
label: "Theme Repo",
id: BDFDB.ContextMenuUtils.createItemId(this.name, "repo"),
action: _ => {
BDFDB.LibraryModules.UserSettingsUtils.open("themerepo");
}
action: _ => BDFDB.LibraryModules.UserSettingsUtils.open("themerepo")
}));
});
}