fix modal flash

This commit is contained in:
saml33 2024-01-17 14:59:40 +11:00
parent 0e2e8f2772
commit 53de7de9fa
1 changed files with 3 additions and 2 deletions

View File

@ -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