aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/components/PluginSettings/components/SettingNumericComponent.tsx5
-rw-r--r--src/components/PluginSettings/components/SettingSelectComponent.tsx1
-rw-r--r--src/components/PluginSettings/components/SettingTextComponent.tsx1
3 files changed, 6 insertions, 1 deletions
diff --git a/src/components/PluginSettings/components/SettingNumericComponent.tsx b/src/components/PluginSettings/components/SettingNumericComponent.tsx
index 12e8e36..446d250 100644
--- a/src/components/PluginSettings/components/SettingNumericComponent.tsx
+++ b/src/components/PluginSettings/components/SettingNumericComponent.tsx
@@ -38,9 +38,12 @@ export function SettingNumericComponent({ option, pluginSettings, definedSetting
function handleChange(newValue) {
const isValid = option.isValid?.call(definedSettings, newValue) ?? true;
+
+ setError(null);
if (typeof isValid === "string") setError(isValid);
else if (!isValid) setError("Invalid input provided.");
- else if (option.type === OptionType.NUMBER && BigInt(newValue) >= MAX_SAFE_NUMBER) {
+
+ if (option.type === OptionType.NUMBER && BigInt(newValue) >= MAX_SAFE_NUMBER) {
setState(`${Number.MAX_SAFE_INTEGER}`);
onChange(serialize(newValue));
} else {
diff --git a/src/components/PluginSettings/components/SettingSelectComponent.tsx b/src/components/PluginSettings/components/SettingSelectComponent.tsx
index 164a29a..97c1707 100644
--- a/src/components/PluginSettings/components/SettingSelectComponent.tsx
+++ b/src/components/PluginSettings/components/SettingSelectComponent.tsx
@@ -36,6 +36,7 @@ export function SettingSelectComponent({ option, pluginSettings, definedSettings
if (typeof isValid === "string") setError(isValid);
else if (!isValid) setError("Invalid input provided.");
else {
+ setError(null);
setState(newValue);
onChange(newValue);
}
diff --git a/src/components/PluginSettings/components/SettingTextComponent.tsx b/src/components/PluginSettings/components/SettingTextComponent.tsx
index 599593f..9eccb10 100644
--- a/src/components/PluginSettings/components/SettingTextComponent.tsx
+++ b/src/components/PluginSettings/components/SettingTextComponent.tsx
@@ -34,6 +34,7 @@ export function SettingTextComponent({ option, pluginSettings, definedSettings,
if (typeof isValid === "string") setError(isValid);
else if (!isValid) setError("Invalid input provided.");
else {
+ setError(null);
setState(newValue);
onChange(newValue);
}