customRPC fixes (#1666)

Co-authored-by: V <vendicated@riseup.net>
This commit is contained in:
AutumnVN 2023-08-25 19:30:12 +07:00 committed by GitHub
parent eca4af829f
commit ebe10d3fad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 40 additions and 57 deletions

View file

@ -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 (