From ebe10d3fad85fc46b7df1637807734d950cd70bb Mon Sep 17 00:00:00 2001 From: AutumnVN Date: Fri, 25 Aug 2023 19:30:12 +0700 Subject: customRPC fixes (#1666) Co-authored-by: V --- .../PluginSettings/components/SettingTextComponent.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/components') diff --git a/src/components/PluginSettings/components/SettingTextComponent.tsx b/src/components/PluginSettings/components/SettingTextComponent.tsx index 9eccb10..abf1bbb 100644 --- a/src/components/PluginSettings/components/SettingTextComponent.tsx +++ b/src/components/PluginSettings/components/SettingTextComponent.tsx @@ -33,11 +33,10 @@ export function SettingTextComponent({ option, pluginSettings, definedSettings, const isValid = option.isValid?.call(definedSettings, newValue) ?? true; if (typeof isValid === "string") setError(isValid); else if (!isValid) setError("Invalid input provided."); - else { - setError(null); - setState(newValue); - onChange(newValue); - } + else setError(null); + + setState(newValue); + onChange(newValue); } return ( -- cgit