From a31423034fd99761217130ac5decad6d8d4bf324 Mon Sep 17 00:00:00 2001 From: Elvyra <88881326+EepyElvyra@users.noreply.github.com> Date: Fri, 3 Jan 2025 21:07:12 +0100 Subject: [PATCH 1/2] Guhh nobody saw this --- .../PluginSettings/components/SettingArrayComponent.tsx | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/components/PluginSettings/components/SettingArrayComponent.tsx b/src/components/PluginSettings/components/SettingArrayComponent.tsx index 283bb9f2c..8d7e706ef 100644 --- a/src/components/PluginSettings/components/SettingArrayComponent.tsx +++ b/src/components/PluginSettings/components/SettingArrayComponent.tsx @@ -69,12 +69,7 @@ export function SettingArrayComponent({ } return (GuildStore.getGuild(channel.guild_id)?.name ?? "Unknown Guild") + " - " + channel.name; } - - /* Pseudocode for handling submit */ function handleSubmit() { - // Handle the submit action for the specific item - // This could involve updating the state, making an API call, etc. - // Clear the input field after submission const inputElement = document.getElementById(`vc-plugin-modal-input-${option.type === OptionType.CHANNELS ? "channel" : option.type === OptionType.GUILDS ? "guild" : option.type === OptionType.USERS ? "user" : "string"}`) as HTMLInputElement; if (!inputElement || inputElement.value === "") { return; From 5ae2d03c8b778d35b0d6a26a707a80e923c6080f Mon Sep 17 00:00:00 2001 From: Elvyra <88881326+EepyElvyra@users.noreply.github.com> Date: Fri, 3 Jan 2025 23:56:45 +0000 Subject: [PATCH 2/2] Don't clear input on error --- .../PluginSettings/components/SettingArrayComponent.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/PluginSettings/components/SettingArrayComponent.tsx b/src/components/PluginSettings/components/SettingArrayComponent.tsx index 8d7e706ef..3a7581950 100644 --- a/src/components/PluginSettings/components/SettingArrayComponent.tsx +++ b/src/components/PluginSettings/components/SettingArrayComponent.tsx @@ -77,7 +77,6 @@ export function SettingArrayComponent({ // 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 = ""; return; } setItems([...items, inputElement.value]);