fix restricted country modal flicker

This commit is contained in:
saml33 2024-01-06 21:54:56 +11:00
parent 08c3c8e7b4
commit 355c263fc8
1 changed files with 6 additions and 1 deletions

View File

@ -231,12 +231,17 @@ const RestrictedCountryCheck = () => {
NON_RESTRICTED_JURISDICTION_KEY,
false,
)
const [mounted, setMounted] = useState(false)
useEffect(() => {
setMounted(true)
}, [])
const showModal = useMemo(() => {
return !confirmedCountry && !ipCountry && !loadingIpCountry
}, [confirmedCountry, ipCountry, loadingIpCountry])
return showModal ? (
return showModal && mounted ? (
<RestrictedCountryModal
isOpen={showModal}
onClose={() => setConfirmedCountry(true)}