File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -16,14 +16,15 @@ import { ThemedView } from '@/components/ThemedView'
1616
1717export default function ( ) {
1818 const router = useRouter ( )
19+ const [ loading , setLoading ] = useState < boolean > ( true )
1920 const [ user , setUser ] = useState < UserProfile > ( )
2021
2122 useEffect ( ( ) => {
23+ setLoading ( true )
2224 Line . getProfile ( )
2325 . then ( setUser )
24- . catch ( ( ) => {
25- Alert . alert ( strings . errorTitle , strings . errorMessage )
26- } )
26+ . catch ( ( ) => Alert . alert ( strings . errorTitle , strings . errorMessage ) )
27+ . finally ( ( ) => setLoading ( false ) )
2728 } , [ ] )
2829
2930 function logOut ( ) {
@@ -33,7 +34,7 @@ export default function () {
3334 } )
3435 }
3536
36- if ( ! user ) {
37+ if ( loading ) {
3738 return (
3839 < ThemedView style = { styles . container } >
3940 < ActivityIndicator size = "large" />
You can’t perform that action at this time.
0 commit comments