Unmount web portals until policy update completed
This commit is contained in:
@@ -22,7 +22,10 @@ import {EmailDialog} from '#/components/dialogs/EmailDialog'
|
||||
import {LinkWarningDialog} from '#/components/dialogs/LinkWarning'
|
||||
import {MutedWordsDialog} from '#/components/dialogs/MutedWords'
|
||||
import {SigninDialog} from '#/components/dialogs/Signin'
|
||||
import {Outlet as PolicyUpdateOverlayPortalOutlet} from '#/components/PolicyUpdateOverlay'
|
||||
import {
|
||||
Outlet as PolicyUpdateOverlayPortalOutlet,
|
||||
usePolicyUpdateStateContext,
|
||||
} from '#/components/PolicyUpdateOverlay'
|
||||
import {Outlet as PortalOutlet} from '#/components/Portal'
|
||||
import {FlatNavigator, RoutesContainer} from '#/Navigation'
|
||||
import {Composer} from './Composer.web'
|
||||
@@ -38,6 +41,7 @@ function ShellInner() {
|
||||
const {_} = useLingui()
|
||||
const showDrawer = !isDesktop && isDrawerOpen
|
||||
const [showDrawerDelayedExit, setShowDrawerDelayedExit] = useState(showDrawer)
|
||||
const policyUpdateState = usePolicyUpdateStateContext()
|
||||
|
||||
useLayoutEffect(() => {
|
||||
if (showDrawer !== showDrawerDelayedExit) {
|
||||
@@ -75,7 +79,13 @@ function ShellInner() {
|
||||
<AgeAssuranceRedirectDialog />
|
||||
<LinkWarningDialog />
|
||||
<Lightbox />
|
||||
<PortalOutlet />
|
||||
|
||||
{/* Until policy update has been completed by the user, don't render anything that is portaled */}
|
||||
{policyUpdateState.completed && (
|
||||
<>
|
||||
<PortalOutlet />
|
||||
</>
|
||||
)}
|
||||
|
||||
{showDrawerDelayedExit && (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user