@@ -3,7 +3,9 @@ import * as React from 'react'
33import { View } from 'react-native'
44import { sprintf } from 'sprintf-js'
55
6+ import { getFirstOpenInfo } from '../../actions/FirstOpenActions'
67import { DONE_THRESHOLD , SPECIAL_CURRENCY_INFO } from '../../constants/WalletAndCurrencyConstants'
8+ import { useAsyncValue } from '../../hooks/useAsyncValue'
79import { useHandler } from '../../hooks/useHandler'
810import { useWatch } from '../../hooks/useWatch'
911import { toPercentString } from '../../locales/intl'
@@ -21,18 +23,20 @@ interface OwnProps {
2123 wallet : EdgeCurrencyWallet
2224 tokenId : EdgeTokenId
2325 navigation : NavigationBase
24- countryCode ?: string
2526}
2627
2728type Props = OwnProps
2829
2930export const BuyCrypto = ( props : Props ) => {
30- const { countryCode , wallet, tokenId, navigation } = props
31+ const { wallet, tokenId, navigation } = props
3132 const theme = useTheme ( )
3233 const styles = getStyles ( theme )
3334
3435 const syncRatio = useWatch ( wallet , 'syncRatio' )
3536
37+ const [ firstOpenInfo ] = useAsyncValue ( async ( ) => await getFirstOpenInfo ( ) )
38+ const { countryCode } = firstOpenInfo ?? { }
39+
3640 const handlePress = useHandler ( ( ) => {
3741 navigation . navigate ( 'buyTab' , { screen : 'pluginListBuy' } )
3842 } )
0 commit comments