Add Old Settings v1 sections back
This commit is contained in:
parent
2b1a0c5357
commit
f50bac6277
3 changed files with 49 additions and 19 deletions
|
|
@ -24,14 +24,22 @@ export default definePlugin({
|
|||
patches: [],
|
||||
|
||||
async start() {
|
||||
const customEntriesSections = SettingsPlugin.customEntries;
|
||||
customEntriesSections.push({
|
||||
key: "i_remember_you",
|
||||
const { customEntries, customSections } = SettingsPlugin;
|
||||
|
||||
customEntries.push({
|
||||
key: "equicord_i_remember_you",
|
||||
title: "I Remember You",
|
||||
Component: () => <DataUI usersCollection={data.usersCollection} />,
|
||||
Icon: EyeIcon
|
||||
});
|
||||
|
||||
customSections.push(() => ({
|
||||
section: "EquicordIRememberYou",
|
||||
label: "IRememberYou",
|
||||
element: () => <DataUI plugin={this} usersCollection={data.usersCollection} />,
|
||||
id: "IRememberYou"
|
||||
}));
|
||||
|
||||
const data = (this.dataManager = await new Data().withStart());
|
||||
|
||||
await data.initializeUsersCollection();
|
||||
|
|
@ -45,9 +53,11 @@ export default definePlugin({
|
|||
|
||||
stop() {
|
||||
const dataManager = this.dataManager as Data;
|
||||
const customEntriesSections = SettingsPlugin.customEntries;
|
||||
const i = customEntriesSections.findIndex(entry => entry.key === "i_remember_you");
|
||||
if (i !== -1) customEntriesSections.splice(i, 1);
|
||||
const { customEntries, customSections } = SettingsPlugin;
|
||||
const entry = customEntries.findIndex(entry => entry.key === "equicord_i_remember_you");
|
||||
const section = customSections.findIndex(section => section({} as any).id === "IRememberYou");
|
||||
if (entry !== -1) customEntries.splice(entry, 1);
|
||||
if (section !== -1) customSections.splice(section, 1);
|
||||
|
||||
removeMessagePreSendListener(dataManager._onMessagePreSend_preSend);
|
||||
clearInterval(dataManager._storageAutoSaveProtocol_interval);
|
||||
|
|
|
|||
|
|
@ -22,23 +22,33 @@ export default definePlugin({
|
|||
startAt: StartAt.WebpackReady,
|
||||
toolboxActions: {
|
||||
"Open Icons Tab"() {
|
||||
openUserSettingsPanel("icon_viewer");
|
||||
openUserSettingsPanel("equicord_icon_viewer");
|
||||
},
|
||||
},
|
||||
settingsAboutComponent: SettingsAbout,
|
||||
start() {
|
||||
const customEntriesSections = SettingsPlugin.customEntries;
|
||||
const { customEntries, customSections } = SettingsPlugin;
|
||||
|
||||
customEntriesSections.push({
|
||||
key: "icon_viewer",
|
||||
customEntries.push({
|
||||
key: "equicord_icon_viewer",
|
||||
title: "Icon Finder",
|
||||
Component: IconsTab,
|
||||
Icon: MagnifyingGlassIcon
|
||||
});
|
||||
|
||||
customSections.push(() => ({
|
||||
section: "EquicordDiscordIcons",
|
||||
label: "Icon Finder",
|
||||
element: IconsTab,
|
||||
className: "vc-discord-icons",
|
||||
id: "IconViewer"
|
||||
}));
|
||||
},
|
||||
stop() {
|
||||
const customEntriesSections = SettingsPlugin.customEntries;
|
||||
const i = customEntriesSections.findIndex(entry => entry.key === "icon_viewer");
|
||||
if (i !== -1) customEntriesSections.splice(i, 1);
|
||||
const { customEntries, customSections } = SettingsPlugin;
|
||||
const entry = customEntries.findIndex(entry => entry.key === "equicord_icon_viewer");
|
||||
const section = customSections.findIndex(section => section({} as any).id === "IconViewer");
|
||||
if (entry !== -1) customEntries.splice(entry, 1);
|
||||
if (section !== -1) customSections.splice(section, 1);
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -24,19 +24,29 @@ export default definePlugin({
|
|||
},
|
||||
|
||||
start() {
|
||||
const customEntriesSections = SettingsPlugin.customEntries;
|
||||
const { customEntries, customSections } = SettingsPlugin;
|
||||
|
||||
customEntriesSections.push({
|
||||
key: "theme_library",
|
||||
customEntries.push({
|
||||
key: "equicord_theme_library",
|
||||
title: "Theme Library",
|
||||
Component: require("./components/ThemeTab").default,
|
||||
Icon: ColorPaletteIcon
|
||||
});
|
||||
|
||||
customSections.push(() => ({
|
||||
section: "EquicordThemeLibrary",
|
||||
label: "Theme Library",
|
||||
searchableTitles: ["Theme Library"],
|
||||
element: require("./components/ThemeTab").default,
|
||||
id: "ThemeLibrary",
|
||||
}));
|
||||
},
|
||||
|
||||
stop() {
|
||||
const customEntriesSections = SettingsPlugin.customEntries;
|
||||
const i = customEntriesSections.findIndex(entry => entry.key === "theme_library");
|
||||
if (i !== -1) customEntriesSections.splice(i, 1);
|
||||
const { customEntries, customSections } = SettingsPlugin;
|
||||
const entry = customEntries.findIndex(entry => entry.key === "equicord_theme_library");
|
||||
const section = customSections.findIndex(section => section({} as any).id === "ThemeLibrary");
|
||||
if (entry !== -1) customEntries.splice(entry, 1);
|
||||
if (section !== -1) customSections.splice(section, 1);
|
||||
},
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue