Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix policy state (#8821)

* Mark completedForDevice prior to creating an account

* Mark policies as completed after initial create account step

authored by

Eric Bailey and committed by
GitHub
a3bb8cca bb949e4f

+5 -15
+4
src/screens/Signup/StepInfo/index.tsx
··· 20 20 import {Lock_Stroke2_Corner0_Rounded as Lock} from '#/components/icons/Lock' 21 21 import {Ticket_Stroke2_Corner0_Rounded as Ticket} from '#/components/icons/Ticket' 22 22 import {Loader} from '#/components/Loader' 23 + import {usePreemptivelyCompleteActivePolicyUpdate} from '#/components/PolicyUpdateOverlay/usePreemptivelyCompleteActivePolicyUpdate' 23 24 import {BackNextButtons} from '../BackNextButtons' 24 25 25 26 function sanitizeDate(date: Date): Date { ··· 45 46 }) { 46 47 const {_} = useLingui() 47 48 const {state, dispatch} = useSignupContext() 49 + const preemptivelyCompleteActivePolicyUpdate = 50 + usePreemptivelyCompleteActivePolicyUpdate() 48 51 49 52 const inviteCodeValueRef = useRef<string>(state.inviteCode) 50 53 const emailValueRef = useRef<string>(state.email) ··· 129 132 }) 130 133 } 131 134 135 + preemptivelyCompleteActivePolicyUpdate() 132 136 dispatch({type: 'setInviteCode', value: inviteCode}) 133 137 dispatch({type: 'setEmail', value: email}) 134 138 dispatch({type: 'setPassword', value: password})
+1 -15
src/screens/Signup/state.ts
··· 15 15 import {logger} from '#/logger' 16 16 import {useSessionApi} from '#/state/session' 17 17 import {useOnboardingDispatch} from '#/state/shell' 18 - import {usePreemptivelyCompleteActivePolicyUpdate} from '#/components/PolicyUpdateOverlay/usePreemptivelyCompleteActivePolicyUpdate' 19 18 20 19 export type ServiceDescription = ComAtprotoServerDescribeServer.OutputSchema 21 20 ··· 253 252 const {_} = useLingui() 254 253 const {createAccount} = useSessionApi() 255 254 const onboardingDispatch = useOnboardingDispatch() 256 - const preemptivelyCompleteActivePolicyUpdate = 257 - usePreemptivelyCompleteActivePolicyUpdate() 258 255 259 256 return useCallback( 260 257 async (state: SignupState, dispatch: (action: SignupAction) => void) => { ··· 328 325 }, 329 326 ) 330 327 331 - /** 332 - * Marks any active policy update as completed, since user just agreed 333 - * to TOS/privacy during sign up 334 - */ 335 - preemptivelyCompleteActivePolicyUpdate() 336 - 337 328 /* 338 329 * Must happen last so that if the user has multiple tabs open and 339 330 * createAccount fails, one tab is not stuck in onboarding — Eric ··· 372 363 dispatch({type: 'setIsLoading', value: false}) 373 364 } 374 365 }, 375 - [ 376 - _, 377 - onboardingDispatch, 378 - createAccount, 379 - preemptivelyCompleteActivePolicyUpdate, 380 - ], 366 + [_, onboardingDispatch, createAccount], 381 367 ) 382 368 }