about summary refs log tree commit diff
path: root/src/screens/Signup
diff options
context:
space:
mode:
authorEric Bailey <git@esb.lol>2025-08-06 15:15:52 -0500
committerGitHub <noreply@github.com>2025-08-06 15:15:52 -0500
commit328aa2be9482f77cb1cf86c5d227fdcee9981b16 (patch)
tree27174f10e0fe80288c0cd6907f8686486131d082 /src/screens/Signup
parentfd37d92f85ddf0f075a67c4e9b2d85bef38f1835 (diff)
downloadvoidsky-328aa2be9482f77cb1cf86c5d227fdcee9981b16.tar.zst
[APP-1356] Policy update dialog (#8782)
* Add blocking announcement dialog feature

* WIP custom dialog

* Rework dialog and add native FocusScope

* Lock scroll on web, fix backdrop

* Add web FocusScope

* Create custom Outlet for these announcements

* Clean up FocusScope native impl

* Comments

* Some styling fixes

* Handle screen reader specifically

* Clean up state, remove Portal edits

* Reorg, rename

* Add syncing, tests

* Revert dialog updates

* Revert formatting

* Delete unused file

* Format

* Add FullWindowOverlay

* remove mmkv storage in debug btn

* Add debug code

* fix taps passing through on iOS

* Reorg

* Reorg, rename everything

* Complete policy update after signup

* Add logger

* Move context around, unmount portals on native

* Move a11y prop into FocusScope

* Remove useMemo

* Update dates

* Move debug to dev settings

* Unmount web portals until policy update completed

* UPdate dates

---------

Co-authored-by: Samuel Newman <mozzius@protonmail.com>
Diffstat (limited to 'src/screens/Signup')
-rw-r--r--src/screens/Signup/state.ts16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/screens/Signup/state.ts b/src/screens/Signup/state.ts
index 48ea4ccd9..ae0b20f1c 100644
--- a/src/screens/Signup/state.ts
+++ b/src/screens/Signup/state.ts
@@ -15,6 +15,7 @@ import {getAge} from '#/lib/strings/time'
 import {logger} from '#/logger'
 import {useSessionApi} from '#/state/session'
 import {useOnboardingDispatch} from '#/state/shell'
+import {usePreemptivelyCompleteActivePolicyUpdate} from '#/components/PolicyUpdateOverlay/usePreemptivelyCompleteActivePolicyUpdate'
 
 export type ServiceDescription = ComAtprotoServerDescribeServer.OutputSchema
 
@@ -252,6 +253,8 @@ export function useSubmitSignup() {
   const {_} = useLingui()
   const {createAccount} = useSessionApi()
   const onboardingDispatch = useOnboardingDispatch()
+  const preemptivelyCompleteActivePolicyUpdate =
+    usePreemptivelyCompleteActivePolicyUpdate()
 
   return useCallback(
     async (state: SignupState, dispatch: (action: SignupAction) => void) => {
@@ -325,6 +328,12 @@ export function useSubmitSignup() {
           },
         )
 
+        /**
+         * Marks any active policy update as completed, since user just agreed
+         * to TOS/privacy during sign up
+         */
+        preemptivelyCompleteActivePolicyUpdate()
+
         /*
          * Must happen last so that if the user has multiple tabs open and
          * createAccount fails, one tab is not stuck in onboarding — Eric
@@ -363,6 +372,11 @@ export function useSubmitSignup() {
         dispatch({type: 'setIsLoading', value: false})
       }
     },
-    [_, onboardingDispatch, createAccount],
+    [
+      _,
+      onboardingDispatch,
+      createAccount,
+      preemptivelyCompleteActivePolicyUpdate,
+    ],
   )
 }