mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-13 00:23:02 -04:00
Fix everything broken by recent Discord update (#3177)
Co-authored-by: sadan <117494111+sadan4@users.noreply.github.com> Co-authored-by: Vendicated <vendicated@riseup.net>
This commit is contained in:
parent
cdc756193e
commit
33d4f13a24
41 changed files with 389 additions and 244 deletions
|
@ -221,15 +221,13 @@ export function migratePluginSettings(name: string, ...oldNames: string[]) {
|
|||
}
|
||||
|
||||
export function migratePluginSetting(pluginName: string, oldSetting: string, newSetting: string) {
|
||||
const { plugins } = SettingsStore.plain;
|
||||
const settings = SettingsStore.plain.plugins[pluginName];
|
||||
if (!settings) return;
|
||||
|
||||
if (
|
||||
plugins?.[pluginName]?.[oldSetting] == null ||
|
||||
plugins[pluginName][newSetting] != null
|
||||
) return;
|
||||
if (!Object.hasOwn(settings, oldSetting) || Object.hasOwn(settings, newSetting)) return;
|
||||
|
||||
plugins[pluginName][newSetting] = plugins[pluginName][oldSetting];
|
||||
delete plugins[pluginName][oldSetting];
|
||||
settings[newSetting] = settings[oldSetting];
|
||||
delete settings[oldSetting];
|
||||
SettingsStore.markAsChanged();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue