From e32f280f472a6793c10f23d6363e3577dfef39db Mon Sep 17 00:00:00 2001
From: Chenyu Huang <itschenyu@gmail.com>
Date: Tue, 19 Aug 2025 15:59:12 -0700
Subject: clean up onSuccess callback

---
 src/components/dialogs/StarterPackDialog.tsx | 23 +++++------------------
 1 file changed, 5 insertions(+), 18 deletions(-)

(limited to 'src/components/dialogs/StarterPackDialog.tsx')

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])
 
-- 
cgit 1.4.1

