diff --git a/Plugins/PluginRepo/PluginRepo.plugin.js b/Plugins/PluginRepo/PluginRepo.plugin.js index 9390bf65d9..c0e3dd50a0 100644 --- a/Plugins/PluginRepo/PluginRepo.plugin.js +++ b/Plugins/PluginRepo/PluginRepo.plugin.js @@ -14,12 +14,12 @@ module.exports = (_ => { "info": { "name": "PluginRepo", "author": "DevilBro", - "version": "2.1.1", + "version": "2.1.2", "description": "Allow you to look at all plugins from the plugin repo and download them on the fly" }, "changeLog": { "fixed": { - "New Meta": "Fixed some issues with the meta parsing" + "New Settings Order": "Fixed for new settings order" } } }; @@ -657,12 +657,11 @@ module.exports = (_ => { processSettingsView (e) { if (BDFDB.ArrayUtils.is(e.instance.props.sections) && e.instance.props.sections[0] && e.instance.props.sections[0].label == BDFDB.LanguageUtils.LanguageStrings.USER_SETTINGS) { e.instance.props.sections = e.instance.props.sections.filter(n => n.section != "pluginrepo"); - let oldSettings = !e.instance.props.sections.find(n => n.section == "plugins"); - let index = e.instance.props.sections.indexOf(e.instance.props.sections.find(oldSettings ? n => n.section == BDFDB.DiscordConstants.UserSettingsSections.DEVELOPER_OPTIONS : n => n.section == BDFDB.DiscordConstants.UserSettingsSections.CHANGE_LOG || n.section == "changelog")); + let index = e.instance.props.sections.indexOf(e.instance.props.sections.find(n => n.section == "themes") || e.instance.props.sections.find(n => n.section == BDFDB.DiscordConstants.UserSettingsSections.DEVELOPER_OPTIONS)); if (index > -1) { - e.instance.props.sections.splice(oldSettings ? index + 1 : index - 1, 0, { - label: "Plugin Repo", + e.instance.props.sections.splice(index + 1, 0, { section: "pluginrepo", + label: "Plugin Repo", element: _ => { let options = Object.assign({}, modalSettings); options.updated = options.updated && !showOnlyOutdated; @@ -675,7 +674,7 @@ module.exports = (_ => { return BDFDB.ReactUtils.createElement(RepoListComponent, options, true); } }); - if (oldSettings) e.instance.props.sections.splice(index + 1, 0, {section: "DIVIDER"}); + if (!e.instance.props.sections.find(n => n.section == "plugins")) e.instance.props.sections.splice(index + 1, 0, {section: "DIVIDER"}); } } } diff --git a/Plugins/ThemeRepo/ThemeRepo.plugin.js b/Plugins/ThemeRepo/ThemeRepo.plugin.js index 071adc5647..8a0785e13d 100644 --- a/Plugins/ThemeRepo/ThemeRepo.plugin.js +++ b/Plugins/ThemeRepo/ThemeRepo.plugin.js @@ -14,12 +14,12 @@ module.exports = (_ => { "info": { "name": "ThemeRepo", "author": "DevilBro", - "version": "2.1.1", + "version": "2.1.2", "description": "Allow you to preview all themes from the theme repo and download them on the fly" }, "changeLog": { "fixed": { - "New React Structure": "Fixed for new internal react structure" + "New Settings Order": "Fixed for new settings order" } } }; @@ -950,13 +950,11 @@ module.exports = (_ => { processSettingsView (e) { if (BDFDB.ArrayUtils.is(e.instance.props.sections) && e.instance.props.sections[0] && e.instance.props.sections[0].label == BDFDB.LanguageUtils.LanguageStrings.USER_SETTINGS) { e.instance.props.sections = e.instance.props.sections.filter(n => n.section != "themerepo"); - let oldSettings = !e.instance.props.sections.find(n => n.section == "themes"); - let isPRinjected = oldSettings && e.instance.props.sections.find(n => n.section == "pluginrepo"); - let index = e.instance.props.sections.indexOf(e.instance.props.sections.find(oldSettings ? (isPRinjected ? n => n.section == "pluginrepo" : n => n.section == BDFDB.DiscordConstants.UserSettingsSections.DEVELOPER_OPTIONS) : n => n.section == BDFDB.DiscordConstants.UserSettingsSections.CHANGE_LOG || n.section == "changelog")); + let index = e.instance.props.sections.indexOf(e.instance.props.sections.find(n => n.section == "pluginrepo") || e.instance.props.sections.find(n => n.section == "themes") || e.instance.props.sections.find(n => n.section == BDFDB.DiscordConstants.UserSettingsSections.DEVELOPER_OPTIONS)); if (index > -1) { - e.instance.props.sections.splice(oldSettings ? index + 1 : index - 1, 0, { - label: "Theme Repo", + e.instance.props.sections.splice(index + 1, 0, { section: "themerepo", + label: "Theme Repo", element: _ => { let options = Object.assign({}, modalSettings); options.updated = options.updated && !showOnlyOutdated; @@ -973,7 +971,7 @@ module.exports = (_ => { return BDFDB.ReactUtils.createElement(RepoListComponent, options); } }); - if (oldSettings && !isPRinjected) e.instance.props.sections.splice(index + 1, 0, {section: "DIVIDER"}); + if (!e.instance.props.sections.find(n => n.section == "plugins" || n.section == "pluginrepo")) e.instance.props.sections.splice(index + 1, 0, {section: "DIVIDER"}); } } }