From 4431595bb937bacc25feaa0c7742dc1c198433f5 Mon Sep 17 00:00:00 2001 From: Nicolas Burtey Date: Mon, 18 Dec 2023 16:04:50 -0600 Subject: [PATCH] chore: only ask for rate us on successful payment --- .../send-bitcoin-completed-screen.tsx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/app/screens/send-bitcoin-screen/send-bitcoin-completed-screen.tsx b/app/screens/send-bitcoin-screen/send-bitcoin-completed-screen.tsx index 111ff09222..aeb3db7698 100644 --- a/app/screens/send-bitcoin-screen/send-bitcoin-completed-screen.tsx +++ b/app/screens/send-bitcoin-screen/send-bitcoin-completed-screen.tsx @@ -91,8 +91,16 @@ const SendBitcoinCompletedScreen: React.FC = ({ route }) => { const FEEDBACK_DELAY = 3000 const CALLBACK_DELAY = 3000 + useEffect(() => { - if (!feedbackModalShown) { + if (!showSuggestionModal) { + const navigateToHomeTimeout = setTimeout(navigation.popToTop, CALLBACK_DELAY) + return () => clearTimeout(navigateToHomeTimeout) + } + }, [showSuggestionModal, navigation]) + + useEffect(() => { + if (!feedbackModalShown && status === "SUCCESS") { const feedbackTimeout = setTimeout(() => { requestFeedback() }, FEEDBACK_DELAY) @@ -100,11 +108,7 @@ const SendBitcoinCompletedScreen: React.FC = ({ route }) => { clearTimeout(feedbackTimeout) } } - if (!showSuggestionModal) { - const navigateToHomeTimeout = setTimeout(navigation.popToTop, CALLBACK_DELAY) - return () => clearTimeout(navigateToHomeTimeout) - } - }, [client, feedbackModalShown, LL, showSuggestionModal, navigation, requestFeedback]) + }, [feedbackModalShown, requestFeedback, status]) const MainIcon = () => { switch (status) {