@@ -34,6 +34,7 @@ export default function Login({ challenge, clinical=false, authonly=false, clien
34
34
const router = useRouter ( ) ;
35
35
const [ error , setError ] = useState ( "" ) ;
36
36
const [ isError , setIsError ] = useState ( false ) ;
37
+ const [ isProcess , setIsProcess ] = useState ( false ) ;
37
38
const [ isChecking , setIsChecking ] = useState ( false ) ;
38
39
const [ isTimeout , setIsTimeout ] = useState ( false ) ;
39
40
const [ isAvailable , setIsAvailable ] = useState < boolean | null > ( null ) ;
@@ -73,7 +74,7 @@ export default function Login({ challenge, clinical=false, authonly=false, clien
73
74
// Check if user has an account
74
75
localStorage . setItem ( 'email' , email ) ;
75
76
setIsChecking ( true ) ;
76
- setIsError ( true ) ;
77
+ setIsProcess ( true ) ;
77
78
const isRegistered = await fetch ( "/api/couchdb/patients/" + email ,
78
79
{ method : "GET" , headers : { "Content-Type" : "application/json" } } )
79
80
. then ( ( res ) => res . json ( ) ) . then ( ( json ) => json . _id ) ;
@@ -227,7 +228,7 @@ export default function Login({ challenge, clinical=false, authonly=false, clien
227
228
if ( email !== '' ) {
228
229
if ( validate ( email ) ) {
229
230
setProgress ( 'Authentication using PassKey...' ) ;
230
- setIsError ( true ) ;
231
+ setIsProcess ( true ) ;
231
232
const cro = parseRequestOptionsFromJSON ( {
232
233
publicKey : {
233
234
challenge,
@@ -386,7 +387,7 @@ export default function Login({ challenge, clinical=false, authonly=false, clien
386
387
) : (
387
388
< Grid style = { { textAlign : "center" } } > New to Trustee? < Link component = "button" onClick = { createPassKey } > Create your Trustee and Passkey</ Link > </ Grid >
388
389
) }
389
- { isError ? (
390
+ { isError || isProcess ? (
390
391
< Button variant = "contained" onClick = { replay } startIcon = { < div > < ReplayIcon /> </ div > } > Start Over</ Button >
391
392
) : ( < div > </ div > ) }
392
393
</ Stack >
0 commit comments