fix invalid characters inputs

This commit is contained in:
SrGooglo 2022-11-28 23:24:05 +00:00 committed by root
parent 7ea3394c61
commit b5bdf63e2e

View File

@ -85,7 +85,10 @@ const steps = [
setValidCharacters(hasValidCharacters(username))
const timer = setTimeout(async () => {
if (!validCharacters) return
if (!validCharacters) {
setLoading(false)
return
}
const request = await app.api.customRequest("main", {
method: "GET",
@ -120,7 +123,7 @@ const steps = [
autoCorrect="off"
autoCapitalize="none"
onPressEnter={submit}
placeholder="@newuser"
placeholder="newuser"
value={username}
onChange={handleUpdate}
status={username.length == 0 ? "default" : loading ? "default" : (isValid() ? "success" : "error")}