diff --git a/src/api/Settings.ts b/src/api/Settings.ts index 0227c4e7f..b2ee81502 100644 --- a/src/api/Settings.ts +++ b/src/api/Settings.ts @@ -224,6 +224,7 @@ export function migrateSettingsToArrays(pluginName: string, settings: string[], for (const setting of settings) { if (SettingsStore.plain.plugins[pluginName] === undefined || typeof SettingsStore.plain.plugins[pluginName][setting] !== "string") continue; logger.info(`Migrating setting ${setting} from ${pluginName} to list`); + // @ts-ignore if (SettingsStore.plain.plugins[pluginName][setting] === "") SettingsStore.plain.plugins[pluginName][setting] = SettingsStore.plain.plugins[pluginName][setting].default ?? []; else SettingsStore.plain.plugins[pluginName][setting] = SettingsStore.plain.plugins[pluginName][setting].split(stringSeparator); } diff --git a/src/components/PluginSettings/components/SettingArrayComponent.tsx b/src/components/PluginSettings/components/SettingArrayComponent.tsx index c208e84db..3980ea164 100644 --- a/src/components/PluginSettings/components/SettingArrayComponent.tsx +++ b/src/components/PluginSettings/components/SettingArrayComponent.tsx @@ -1,20 +1,8 @@ /* - * Vencord, a modification for Discord's desktop app - * Copyright (c) 2022 Vendicated and contributors - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . -*/ + * Vencord, a Discord client mod + * Copyright (c) 2025 Vendicated and contributors + * SPDX-License-Identifier: GPL-3.0-or-later + */ import ErrorBoundary from "@components/ErrorBoundary"; import { Flex } from "@components/Flex"; diff --git a/src/plugins/_api/settingArrays.tsx b/src/plugins/_api/settingArrays.tsx index bd990d13b..35b31c0b1 100644 --- a/src/plugins/_api/settingArrays.tsx +++ b/src/plugins/_api/settingArrays.tsx @@ -57,7 +57,7 @@ function renderRegisteredPlugins(name: string, value: any) { {plugins[plugin].map(setting => ( handleCheckboxClick(plugin, setting)} checked={checkedItems[`${plugin}-${setting}-${value.id}`]} diff --git a/src/utils/types.ts b/src/utils/types.ts index b4aff0fa5..495b4bedb 100644 --- a/src/utils/types.ts +++ b/src/utils/types.ts @@ -264,10 +264,11 @@ export interface PluginSettingSliderDef { stickToMarkers?: boolean; } -export interface PluginSettingListDef{ +export interface PluginSettingListDef { type: OptionType.ARRAY | OptionType.CHANNELS | OptionType.GUILDS | OptionType.USERS; popoutText?: string; hidePopout?: boolean; + default?: any[]; } export interface IPluginOptionComponentProps {