Compare commits

...

1 Commits

Author SHA1 Message Date
Eric Bailey f13b76f807 Add config to disable update overlay, disable it 2025-10-23 10:46:00 -05:00
2 changed files with 17 additions and 2 deletions
@@ -5,3 +5,10 @@ import {ID} from '#/components/PolicyUpdateOverlay/updates/202508/config'
* the relationship is clear.
*/
export const ACTIVE_UPDATE_ID = ID
/**
* Toggle to enable or disable the policy update overlay feature e.g. once an
* update has run its course, set this to false. For new updates, set this to
* true and change `ACTIVE_UPDATE_ID` to the new update ID.
*/
export const POLICY_UPDATE_IS_ENABLED = false
+10 -2
View File
@@ -7,6 +7,7 @@ import {
} from 'react'
import {useSession} from '#/state/session'
import {POLICY_UPDATE_IS_ENABLED} from '#/components/PolicyUpdateOverlay/config'
import {Provider as PortalProvider} from '#/components/PolicyUpdateOverlay/Portal'
import {
type PolicyUpdateState,
@@ -45,8 +46,15 @@ export function Provider({children}: {children?: ReactNode}) {
const {hasSession} = useSession()
const [isReadyToShowOverlay, setIsReadyToShowOverlay] = useState(false)
const state = usePolicyUpdateState({
// only enable the policy update overlay in non-test environments
enabled: isReadyToShowOverlay && hasSession && ENV !== 'e2e',
enabled:
// if the feature is enabled
POLICY_UPDATE_IS_ENABLED &&
// once shell has rendered
isReadyToShowOverlay &&
// only once logged in
hasSession &&
// only enabled in non-test environments
ENV !== 'e2e',
})
const ctx = useMemo(