File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
src/features/Core/screens Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 1- import React , { useEffect } from 'react' ;
1+ import React , { useEffect , useState } from 'react' ;
22import { SafeAreaView , View , ActivityIndicator } from 'react-native' ;
33import { initStripe } from '@stripe/stripe-react-native' ;
44import { hasRequiredKeys , logError } from 'utils' ;
@@ -20,6 +20,7 @@ const { STRIPE_KEY, APP_IDENTIFIER } = config;
2020 * @component
2121 */
2222const BootScreen = ( { navigation } ) => {
23+ const [ error , setError ] = useState ( null ) ;
2324 // If the required keys are not provided display the setup warning screen
2425 if ( ! hasRequiredKeys ( ) ) {
2526 return < SetupWarningScreen /> ;
@@ -54,6 +55,7 @@ const BootScreen = ({ navigation }) => {
5455 }
5556 } )
5657 . catch ( ( error ) => {
58+ setError ( error ) ;
5759 logError ( error , '[ Error fetching storefront info! ]' ) ;
5860 } )
5961 . finally ( ( ) => {
@@ -62,6 +64,10 @@ const BootScreen = ({ navigation }) => {
6264 } , 300 ) ;
6365 } ) ;
6466
67+ if ( error ) {
68+ return < SetupWarningScreen error = { error } /> ;
69+ }
70+
6571 return (
6672 < SafeAreaView style = { tailwind ( 'bg-white' ) } >
6773 < View style = { tailwind ( 'flex items-center justify-center w-full h-full bg-white' ) } >
You can’t perform that action at this time.
0 commit comments