migratePluginToSettings: Update
This commit is contained in:
parent
eb7c7971e8
commit
37da8ded0a
4 changed files with 7 additions and 14 deletions
|
|
@ -256,16 +256,15 @@ export function migratePluginToSettings(newName: string, oldName: string, ...set
|
|||
const newPlugin = plugins[newName];
|
||||
const oldPlugin = plugins[oldName];
|
||||
|
||||
if (!newPlugin || !oldPlugin) return;
|
||||
|
||||
if (oldPlugin?.enabled) {
|
||||
if (newPlugin && oldPlugin?.enabled) {
|
||||
for (const settingName of settingNames) {
|
||||
logger.info(`Migrating plugin to setting from old name ${oldName} to ${newName} as ${settingName}`);
|
||||
newPlugin[settingName] = true;
|
||||
newPlugin.enabled = true;
|
||||
delete plugins[oldName];
|
||||
SettingsStore.markAsChanged();
|
||||
}
|
||||
|
||||
newPlugin.enabled = true;
|
||||
delete plugins[oldName];
|
||||
SettingsStore.markAsChanged();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import { definePluginSettings, migratePluginToSettings } from "@api/Settings";
|
||||
import { definePluginSettings } from "@api/Settings";
|
||||
import { EquicordDevs } from "@utils/constants";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
|
||||
|
|
@ -47,8 +47,6 @@ const settings = definePluginSettings({
|
|||
}
|
||||
});
|
||||
|
||||
migratePluginToSettings("BetterUserArea", "CleanUserArea", "removeNameplate");
|
||||
|
||||
export default definePlugin({
|
||||
name: "BetterUserArea",
|
||||
description: "Customize and make the user area more clean.",
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
import "./styles.css";
|
||||
|
||||
import { showNotification } from "@api/Notifications";
|
||||
import { definePluginSettings, migratePluginToSettings } from "@api/Settings";
|
||||
import { definePluginSettings } from "@api/Settings";
|
||||
import ErrorBoundary from "@components/ErrorBoundary";
|
||||
import { copyToClipboard } from "@utils/clipboard";
|
||||
import { EquicordDevs } from "@utils/constants";
|
||||
|
|
@ -19,7 +19,6 @@ import { Menu, Toasts } from "@webpack/common";
|
|||
|
||||
import { ContactsList } from "./types";
|
||||
|
||||
migratePluginToSettings("ExportMessages", "ExportContacts", "exportContacts");
|
||||
const settings = definePluginSettings({
|
||||
openFileAfterExport: {
|
||||
type: OptionType.BOOLEAN,
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
|
||||
import "./styles.css";
|
||||
|
||||
import { migratePluginToSettings } from "@api/Settings";
|
||||
import ErrorBoundary from "@components/ErrorBoundary";
|
||||
import { Devs, EquicordDevs } from "@utils/constants";
|
||||
import definePlugin from "@utils/types";
|
||||
|
|
@ -31,8 +30,6 @@ import { TidalLyrics } from "./tidal/lyrics/components/lyrics";
|
|||
import { TidalPlayer } from "./tidal/TidalPlayer";
|
||||
import { YtmPlayer } from "./youtubeMusic/PlayerComponent";
|
||||
|
||||
migratePluginToSettings("MusicControls", "SpotifyControls", "showSpotifyControls");
|
||||
migratePluginToSettings("MusicControls", "SpotifyLyrics", "showSpotifyLyrics");
|
||||
export default definePlugin({
|
||||
name: "MusicControls",
|
||||
description: "Music Controls and Lyrics for multiple services ",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue