mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-01-10 09:56:24 +00:00
fixes
This commit is contained in:
parent
716b75995b
commit
c302b3cb7d
4 changed files with 8 additions and 18 deletions
|
@ -224,6 +224,7 @@ export function migrateSettingsToArrays(pluginName: string, settings: string[],
|
||||||
for (const setting of settings) {
|
for (const setting of settings) {
|
||||||
if (SettingsStore.plain.plugins[pluginName] === undefined || typeof SettingsStore.plain.plugins[pluginName][setting] !== "string") continue;
|
if (SettingsStore.plain.plugins[pluginName] === undefined || typeof SettingsStore.plain.plugins[pluginName][setting] !== "string") continue;
|
||||||
logger.info(`Migrating setting ${setting} from ${pluginName} to list`);
|
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 ?? [];
|
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);
|
else SettingsStore.plain.plugins[pluginName][setting] = SettingsStore.plain.plugins[pluginName][setting].split(stringSeparator);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,20 +1,8 @@
|
||||||
/*
|
/*
|
||||||
* Vencord, a modification for Discord's desktop app
|
* Vencord, a Discord client mod
|
||||||
* Copyright (c) 2022 Vendicated and contributors
|
* Copyright (c) 2025 Vendicated and contributors
|
||||||
*
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
* 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 <https://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import ErrorBoundary from "@components/ErrorBoundary";
|
import ErrorBoundary from "@components/ErrorBoundary";
|
||||||
import { Flex } from "@components/Flex";
|
import { Flex } from "@components/Flex";
|
||||||
|
|
|
@ -57,7 +57,7 @@ function renderRegisteredPlugins(name: string, value: any) {
|
||||||
{plugins[plugin].map(setting => (
|
{plugins[plugin].map(setting => (
|
||||||
<Menu.MenuCheckboxItem
|
<Menu.MenuCheckboxItem
|
||||||
id={`vc-plugin-settings-${plugin}-${setting}`}
|
id={`vc-plugin-settings-${plugin}-${setting}`}
|
||||||
// @ts-ignore popoutText exists due to this being a list option type FIXMe look at this again
|
// @ts-ignore popoutText exists due to this being a list option type
|
||||||
label={Vencord.Plugins.plugins[plugin].settings?.def[setting].popoutText ?? setting}
|
label={Vencord.Plugins.plugins[plugin].settings?.def[setting].popoutText ?? setting}
|
||||||
action={() => handleCheckboxClick(plugin, setting)}
|
action={() => handleCheckboxClick(plugin, setting)}
|
||||||
checked={checkedItems[`${plugin}-${setting}-${value.id}`]}
|
checked={checkedItems[`${plugin}-${setting}-${value.id}`]}
|
||||||
|
|
|
@ -264,10 +264,11 @@ export interface PluginSettingSliderDef {
|
||||||
stickToMarkers?: boolean;
|
stickToMarkers?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface PluginSettingListDef{
|
export interface PluginSettingListDef {
|
||||||
type: OptionType.ARRAY | OptionType.CHANNELS | OptionType.GUILDS | OptionType.USERS;
|
type: OptionType.ARRAY | OptionType.CHANNELS | OptionType.GUILDS | OptionType.USERS;
|
||||||
popoutText?: string;
|
popoutText?: string;
|
||||||
hidePopout?: boolean;
|
hidePopout?: boolean;
|
||||||
|
default?: any[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IPluginOptionComponentProps {
|
export interface IPluginOptionComponentProps {
|
||||||
|
|
Loading…
Reference in a new issue