close loggedout view when logging in (#4154)

zio/stable
Samuel Newman 2024-05-21 18:49:46 +01:00 committed by GitHub
parent e5a1472974
commit 7334e9fd81
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 0 deletions

View File

@ -19,6 +19,7 @@ import {cleanError} from '#/lib/strings/errors'
import {createFullHandle} from '#/lib/strings/handles'
import {logger} from '#/logger'
import {useSessionApi} from '#/state/session'
import {useLoggedOutViewControls} from '#/state/shell/logged-out'
import {useRequestNotificationsPermission} from 'lib/notifications/notifications'
import {atoms as a, useTheme} from '#/alf'
import {Button, ButtonIcon, ButtonText} from '#/components/Button'
@ -67,6 +68,7 @@ export const LoginForm = ({
const {_} = useLingui()
const {login} = useSessionApi()
const requestNotificationsPermission = useRequestNotificationsPermission()
const {setShowLoggedOut} = useLoggedOutViewControls()
const onPressSelectService = React.useCallback(() => {
Keyboard.dismiss()
@ -113,6 +115,7 @@ export const LoginForm = ({
},
'LoginForm',
)
setShowLoggedOut(false)
requestNotificationsPermission('Login')
} catch (e: any) {
const errMsg = e.toString()