diff options
author | Chenyu Huang <itschenyu@gmail.com> | 2025-08-19 15:59:12 -0700 |
---|---|---|
committer | Chenyu Huang <itschenyu@gmail.com> | 2025-08-19 15:59:12 -0700 |
commit | e32f280f472a6793c10f23d6363e3577dfef39db (patch) | |
tree | 19f8cf1d46944dd61a8cecb75d60a2042a68c094 /src/components/dialogs | |
parent | f42b5831bb831e3b9f925730477a27e01d2b33f4 (diff) | |
download | voidsky-e32f280f472a6793c10f23d6363e3577dfef39db.tar.zst |
clean up onSuccess callback
Diffstat (limited to 'src/components/dialogs')
-rw-r--r-- | src/components/dialogs/StarterPackDialog.tsx | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/src/components/dialogs/StarterPackDialog.tsx b/src/components/dialogs/StarterPackDialog.tsx index 0570859c4..9c36be84d 100644 --- a/src/components/dialogs/StarterPackDialog.tsx +++ b/src/components/dialogs/StarterPackDialog.tsx @@ -35,16 +35,6 @@ import {TimesLarge_Stroke2_Corner0_Rounded} from '../icons/Times' type StarterPackWithMembership = AppBskyGraphGetStarterPacksWithMembership.StarterPackWithMembership -let dialogCallbacks: { - onSuccess?: () => void -} = {} - -export function notifyDialogSuccess() { - if (dialogCallbacks.onSuccess) { - dialogCallbacks.onSuccess() - } -} - export type StarterPackDialogProps = { control: Dialog.DialogControlProps targetDid: string @@ -60,19 +50,16 @@ export function StarterPackDialog({ const navigation = useNavigation<NavigationProp>() const requireEmailVerification = useRequireEmailVerification() - React.useEffect(() => { - dialogCallbacks.onSuccess = () => { - if (!control.isOpen) { - control.open() - } - } - }, [control]) - const navToWizard = React.useCallback(() => { control.close() navigation.navigate('StarterPackWizard', { fromDialog: true, targetDid: targetDid, + onSuccess: () => { + if (!control.isOpen) { + control.open() + } + }, }) }, [navigation, control, targetDid]) |