From 716b75995b413ead0d83605900071fd8a41d9b55 Mon Sep 17 00:00:00 2001 From: Elvy <88881326+EepyElvyra@users.noreply.github.com> Date: Fri, 3 Jan 2025 20:35:05 +0100 Subject: [PATCH] update plugins --- src/api/Settings.ts | 2 +- .../components/SettingArrayComponent.tsx | 5 +- src/plugins/invisibleChat.desktop/index.tsx | 13 +++-- src/plugins/messageTags/index.ts | 53 ++++++++++++------- 4 files changed, 44 insertions(+), 29 deletions(-) diff --git a/src/api/Settings.ts b/src/api/Settings.ts index 0e2fcf89c..0227c4e7f 100644 --- a/src/api/Settings.ts +++ b/src/api/Settings.ts @@ -224,7 +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`); - if (SettingsStore.plain.plugins[pluginName][setting] === "") SettingsStore.plain.plugins[pluginName][setting] = []; + 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 dbf478470..c208e84db 100644 --- a/src/components/PluginSettings/components/SettingArrayComponent.tsx +++ b/src/components/PluginSettings/components/SettingArrayComponent.tsx @@ -91,7 +91,7 @@ export function SettingArrayComponent({ if (!inputElement || inputElement.value === "") { return; } - // TODO add picker for users? + // TODO add picker for users etc? if (option.type !== OptionType.ARRAY && !(inputElement.value.length >= 18 && inputElement.value.length <= 19 && !isNaN(Number(inputElement.value)))) { setError("Value is not a valid snowflake ID"); inputElement.value = ""; @@ -104,7 +104,6 @@ export function SettingArrayComponent({ // FIXME make channels and guilds nicer! - // TODO make string type work return ( {wordsToTitle(wordsFromCamel(id))} @@ -151,13 +150,11 @@ export function SettingArrayComponent({ marginTop: "10px", }} > - {/* Add a single input field */} - {/* Add a submit button */}