fix(iphone login modal crashing the app fixed)

Co-authored-by: Sebastian Palmqvist <PalmN72@users.noreply.github.com>
This commit is contained in:
Lee 2023-11-01 15:02:13 +01:00
parent 8314917bd4
commit 23fb188093
1 changed files with 5 additions and 8 deletions

View File

@ -94,15 +94,10 @@ export const Login = () => {
useEffect(() => {
const loginHandler = async () => {
console.debug('Running loginHandler')
try {
const user = await api.getUser()
await AppStorage.clearPersonalData(user)
showModal(false)
} catch (error) {
console.log(error)
}
const user = await api.getUser()
await AppStorage.clearPersonalData(user)
showModal(false)
}
api.on('login', loginHandler)
return () => {
api.off('login', loginHandler)
@ -203,7 +198,9 @@ export const Login = () => {
})
status.on('OK', () => {
console.log('BankID ok')
showModal(true)
setLoginStatusText(t('auth.loginSuccessful'))
setTimeout(() => showModal(false), 0)
})
} else {
await api.login('201212121212')