From 9654adc9d6df3b75c0936c9577ee74f3a010db3f Mon Sep 17 00:00:00 2001 From: Isha Kakkad Date: Sat, 26 Apr 2025 15:08:16 +0530 Subject: [PATCH 1/4] Fix manual confirmation page shows per diem confirmation page --- src/pages/iou/request/IOURequestStartPage.tsx | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/pages/iou/request/IOURequestStartPage.tsx b/src/pages/iou/request/IOURequestStartPage.tsx index 395942de99a3e..e23c732bb60bd 100644 --- a/src/pages/iou/request/IOURequestStartPage.tsx +++ b/src/pages/iou/request/IOURequestStartPage.tsx @@ -69,16 +69,6 @@ function IOURequestStartPage({ ); const isFromGlobalCreate = isEmptyObject(report?.reportID); - // Clear out the temporary expense if the reportID in the URL has changed from the transaction's reportID. - useFocusEffect( - useCallback(() => { - if (transaction?.reportID === reportID || isLoadingSelectedTab) { - return; - } - initMoneyRequest(reportID, policy, isFromGlobalCreate, transaction?.iouRequestType, transactionRequestType); - }, [transaction, policy, reportID, isFromGlobalCreate, transactionRequestType, isLoadingSelectedTab]), - ); - useEffect(() => { Performance.markEnd(CONST.TIMING.OPEN_CREATE_EXPENSE); }, []); @@ -97,6 +87,15 @@ function IOURequestStartPage({ [policy, reportID, isFromGlobalCreate, transaction], ); + useFocusEffect( + useCallback(() => { + if (isLoadingSelectedTab) { + return; + } + resetIOUTypeIfChanged(transactionRequestType); + }, [resetIOUTypeIfChanged, transactionRequestType, isLoadingSelectedTab]), + ); + const [headerWithBackBtnContainerElement, setHeaderWithBackButtonContainerElement] = useState(null); const [tabBarContainerElement, setTabBarContainerElement] = useState(null); const [activeTabContainerElement, setActiveTabContainerElement] = useState(null); From e53d12b000e14e3810a94989cfda6334939c4c60 Mon Sep 17 00:00:00 2001 From: Isha Kakkad Date: Sat, 26 Apr 2025 15:47:35 +0530 Subject: [PATCH 2/4] Fix merge conflict issues --- src/pages/iou/request/IOURequestStartPage.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/iou/request/IOURequestStartPage.tsx b/src/pages/iou/request/IOURequestStartPage.tsx index 8dd9f1616b1b8..fc6a51348d3f2 100644 --- a/src/pages/iou/request/IOURequestStartPage.tsx +++ b/src/pages/iou/request/IOURequestStartPage.tsx @@ -90,11 +90,12 @@ function IOURequestStartPage({ useFocusEffect( useCallback(() => { + // The test transaction can change the reportID of the transaction on the flow so we should prevent the reportID from being reverted again. if (isLoadingSelectedTab || prevTransactionReportID !== transaction?.reportID) { return; } resetIOUTypeIfChanged(transactionRequestType); - }, [resetIOUTypeIfChanged, transactionRequestType, isLoadingSelectedTab]), + }, [resetIOUTypeIfChanged, transactionRequestType, isLoadingSelectedTab, prevTransactionReportID]), ); const [headerWithBackBtnContainerElement, setHeaderWithBackButtonContainerElement] = useState(null); From fe38b1e802bd17a7097596b91447c253622175cf Mon Sep 17 00:00:00 2001 From: Isha Kakkad Date: Sat, 26 Apr 2025 16:14:56 +0530 Subject: [PATCH 3/4] Fix merge conflict issues --- src/pages/iou/request/IOURequestStartPage.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/iou/request/IOURequestStartPage.tsx b/src/pages/iou/request/IOURequestStartPage.tsx index fc6a51348d3f2..ebb039ab86f3b 100644 --- a/src/pages/iou/request/IOURequestStartPage.tsx +++ b/src/pages/iou/request/IOURequestStartPage.tsx @@ -88,14 +88,14 @@ function IOURequestStartPage({ [policy, reportID, isFromGlobalCreate, transaction], ); - useFocusEffect( + useFocusEffect( useCallback(() => { // The test transaction can change the reportID of the transaction on the flow so we should prevent the reportID from being reverted again. if (isLoadingSelectedTab || prevTransactionReportID !== transaction?.reportID) { return; } resetIOUTypeIfChanged(transactionRequestType); - }, [resetIOUTypeIfChanged, transactionRequestType, isLoadingSelectedTab, prevTransactionReportID]), + }, [transaction?.reportID, resetIOUTypeIfChanged, transactionRequestType, isLoadingSelectedTab, prevTransactionReportID]), ); const [headerWithBackBtnContainerElement, setHeaderWithBackButtonContainerElement] = useState(null); From 06422b17aa46e8e6a7e8762dd9b976a240cd72ab Mon Sep 17 00:00:00 2001 From: Isha Kakkad Date: Sat, 26 Apr 2025 20:56:12 +0530 Subject: [PATCH 4/4] Fix prettier --- src/pages/iou/request/IOURequestStartPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/iou/request/IOURequestStartPage.tsx b/src/pages/iou/request/IOURequestStartPage.tsx index ebb039ab86f3b..738bbbcea5b4c 100644 --- a/src/pages/iou/request/IOURequestStartPage.tsx +++ b/src/pages/iou/request/IOURequestStartPage.tsx @@ -88,7 +88,7 @@ function IOURequestStartPage({ [policy, reportID, isFromGlobalCreate, transaction], ); - useFocusEffect( + useFocusEffect( useCallback(() => { // The test transaction can change the reportID of the transaction on the flow so we should prevent the reportID from being reverted again. if (isLoadingSelectedTab || prevTransactionReportID !== transaction?.reportID) {