diff --git a/src/api/Settings.ts b/src/api/Settings.ts index 4b49e26d..3ca77451 100644 --- a/src/api/Settings.ts +++ b/src/api/Settings.ts @@ -236,6 +236,19 @@ export function migratePluginSettings(name: string, ...oldNames: string[]) { } } +export function migratePluginSetting(pluginName: string, oldSetting: string, newSetting: string) { + const { plugins } = SettingsStore.plain; + + if ( + plugins[pluginName][newSetting] != null || + plugins[pluginName][oldSetting] == null + ) return; + + plugins[pluginName][newSetting] = plugins[pluginName][oldSetting]; + delete plugins[pluginName][oldSetting]; + SettingsStore.markAsChanged(); +} + export function definePluginSettings< Def extends SettingsDefinition, Checks extends SettingsChecks,