Bluesky app fork with some witchin' additions 💫 witchsky.app
bluesky fork client

Add config to disable update overlay, disable it (#9267)

authored by

Eric Bailey and committed by
GitHub
74cb81b6 e28aa7d1

+17 -2
+7
src/components/PolicyUpdateOverlay/config.ts
··· 5 5 * the relationship is clear. 6 6 */ 7 7 export const ACTIVE_UPDATE_ID = ID 8 + 9 + /** 10 + * Toggle to enable or disable the policy update overlay feature e.g. once an 11 + * update has run its course, set this to false. For new updates, set this to 12 + * true and change `ACTIVE_UPDATE_ID` to the new update ID. 13 + */ 14 + export const POLICY_UPDATE_IS_ENABLED = false
+10 -2
src/components/PolicyUpdateOverlay/context.tsx
··· 7 7 } from 'react' 8 8 9 9 import {useSession} from '#/state/session' 10 + import {POLICY_UPDATE_IS_ENABLED} from '#/components/PolicyUpdateOverlay/config' 10 11 import {Provider as PortalProvider} from '#/components/PolicyUpdateOverlay/Portal' 11 12 import { 12 13 type PolicyUpdateState, ··· 45 46 const {hasSession} = useSession() 46 47 const [isReadyToShowOverlay, setIsReadyToShowOverlay] = useState(false) 47 48 const state = usePolicyUpdateState({ 48 - // only enable the policy update overlay in non-test environments 49 - enabled: isReadyToShowOverlay && hasSession && ENV !== 'e2e', 49 + enabled: 50 + // if the feature is enabled 51 + POLICY_UPDATE_IS_ENABLED && 52 + // once shell has rendered 53 + isReadyToShowOverlay && 54 + // only once logged in 55 + hasSession && 56 + // only enabled in non-test environments 57 + ENV !== 'e2e', 50 58 }) 51 59 52 60 const ctx = useMemo(