fix modal flash
This commit is contained in:
parent
0e2e8f2772
commit
53de7de9fa
|
@ -227,14 +227,15 @@ const TermsOfUse = () => {
|
|||
// this will only show if the ip api doesn't return the country
|
||||
const RestrictedCountryCheck = () => {
|
||||
const { ipCountry, loadingIpCountry } = useIpAddress()
|
||||
const groupLoaded = mangoStore((s) => s.groupLoaded)
|
||||
const [confirmedCountry, setConfirmedCountry] = useLocalStorageState(
|
||||
NON_RESTRICTED_JURISDICTION_KEY,
|
||||
false,
|
||||
)
|
||||
|
||||
const showModal = useMemo(() => {
|
||||
return !confirmedCountry && !ipCountry && !loadingIpCountry
|
||||
}, [confirmedCountry, ipCountry, loadingIpCountry])
|
||||
return !confirmedCountry && !ipCountry && !loadingIpCountry && groupLoaded
|
||||
}, [confirmedCountry, ipCountry, loadingIpCountry, groupLoaded])
|
||||
|
||||
return showModal ? (
|
||||
<RestrictedCountryModal
|
||||
|
|
Loading…
Reference in New Issue