1
+ import SetupWarningScreen from 'exceptions/SetupWarningScreen' ;
2
+ import { useStorefront } from 'hooks' ;
1
3
import React , { useEffect , useState } from 'react' ;
2
- import { SafeAreaView , View , ActivityIndicator } from 'react-native' ;
3
- import { initStripe } from '@stripe/stripe-react-native' ;
4
+ import { ActivityIndicator , SafeAreaView , View } from 'react-native' ;
5
+ import RNBootSplash from 'react-native-bootsplash' ;
6
+ import { tailwind } from 'tailwind' ;
4
7
import { hasRequiredKeys , logError } from 'utils' ;
5
- import { useStorefront } from 'hooks' ;
6
- import { set } from 'utils/Storage' ;
7
8
import { setI18nConfig } from 'utils/Localize' ;
8
- import { tailwind } from 'tailwind' ;
9
- import RNBootSplash from 'react-native-bootsplash' ;
10
- import SetupWarningScreen from 'exceptions/SetupWarningScreen' ;
11
- import config from 'config' ;
12
-
13
- const { STRIPE_KEY , APP_IDENTIFIER } = config ;
9
+ import { set } from 'utils/Storage' ;
14
10
15
11
/**
16
12
* BootScreen is a simple initialization screen, will load
@@ -37,32 +33,34 @@ const BootScreen = ({ navigation }) => {
37
33
// Initialize i18n
38
34
setI18nConfig ( ) ;
39
35
40
- // Fetch the about() information
41
- storefront
42
- . about ( )
43
- . then ( ( info ) => {
44
- // Store storefront/network info
45
- set ( 'info' , info ) ;
36
+ useEffect ( ( ) => {
37
+ // Fetch the about() information
38
+ storefront
39
+ . about ( )
40
+ . then ( ( info ) => {
41
+ // Store storefront/network info
42
+ set ( 'info' , info ) ;
46
43
47
- // if is single store only go to storefront screens
48
- if ( info . is_store ) {
49
- return navigation . navigate ( 'StorefrontScreen' , { info } ) ;
50
- }
44
+ // if is single store only go to storefront screens
45
+ if ( info . is_store ) {
46
+ return navigation . navigate ( 'StorefrontScreen' , { info } ) ;
47
+ }
51
48
52
- // if is network/multi-vendor
53
- if ( info . is_network ) {
54
- return navigation . navigate ( 'NetworkScreen' , { info } ) ;
55
- }
56
- } )
57
- . catch ( ( error ) => {
58
- setError ( error ) ;
59
- logError ( error , '[ Error fetching storefront info! ]' ) ;
60
- } )
61
- . finally ( ( ) => {
62
- setTimeout ( ( ) => {
63
- RNBootSplash . hide ( ) ;
64
- } , 300 ) ;
65
- } ) ;
49
+ // if is network/multi-vendor
50
+ if ( info . is_network ) {
51
+ return navigation . navigate ( 'NetworkScreen' , { info } ) ;
52
+ }
53
+ } )
54
+ . catch ( ( error ) => {
55
+ setError ( error ) ;
56
+ logError ( error , '[ Error fetching storefront info! ]' ) ;
57
+ } )
58
+ . finally ( ( ) => {
59
+ setTimeout ( ( ) => {
60
+ RNBootSplash . hide ( ) ;
61
+ } , 300 ) ;
62
+ } ) ;
63
+ } , [ ] ) ;
66
64
67
65
if ( error ) {
68
66
return < SetupWarningScreen error = { error } /> ;
0 commit comments