From 6b5886c0f129b2e297af62e24fe99a033ff3f95a Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Fri, 5 Dec 2025 14:05:32 +0700 Subject: [PATCH 1/2] fix: Add receipt from manual expense, QAB is scan receipt but confirm detail display as manual --- src/pages/iou/request/IOURequestStartPage.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/pages/iou/request/IOURequestStartPage.tsx b/src/pages/iou/request/IOURequestStartPage.tsx index 0dc475b48dc8..a86d5d583ce6 100644 --- a/src/pages/iou/request/IOURequestStartPage.tsx +++ b/src/pages/iou/request/IOURequestStartPage.tsx @@ -69,7 +69,9 @@ function IOURequestStartPage({ const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${reportID}`, {canBeMissing: true}); const [parentReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${report?.parentReportID}`, {canBeMissing: true}); const policy = usePolicy(report?.policyID); - const [selectedTab, selectedTabResult] = useOnyx(`${ONYXKEYS.COLLECTION.SELECTED_TAB}${CONST.TAB.IOU_REQUEST_TYPE}`, {canBeMissing: true}); + const [lastSelectedTab, selectedTabResult] = useOnyx(`${ONYXKEYS.COLLECTION.SELECTED_TAB}${CONST.TAB.IOU_REQUEST_TYPE}`, {canBeMissing: true}); + const [selectedTab, setSelectedTab] = useState(lastSelectedTab); + const isLoadingSelectedTab = shouldUseTab ? isLoadingOnyxValue(selectedTabResult) : false; const [transaction] = useOnyx(`${ONYXKEYS.COLLECTION.TRANSACTION_DRAFT}${getNonEmptyStringOnyxID(route?.params.transactionID)}`, {canBeMissing: true}); const [allPolicies] = useOnyx(ONYXKEYS.COLLECTION.POLICY, {canBeMissing: false}); @@ -251,7 +253,10 @@ function IOURequestStartPage({ { + setSelectedTab(newIouType); + resetIOUTypeIfChanged(newIouType); + }} tabBar={TabSelector} onTabBarFocusTrapContainerElementChanged={setTabBarContainerElement} onActiveTabFocusTrapContainerElementChanged={setActiveTabContainerElement} From 443447aedb306bd0378e9f088d3ecdcf31c4d9d1 Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Fri, 5 Dec 2025 14:28:46 +0700 Subject: [PATCH 2/2] fix perf comment --- src/pages/iou/request/IOURequestStartPage.tsx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/pages/iou/request/IOURequestStartPage.tsx b/src/pages/iou/request/IOURequestStartPage.tsx index a86d5d583ce6..5f6682c184f1 100644 --- a/src/pages/iou/request/IOURequestStartPage.tsx +++ b/src/pages/iou/request/IOURequestStartPage.tsx @@ -173,6 +173,14 @@ function IOURequestStartPage({ ], ); + const onTabSelected = useCallback( + (newIouType: IOURequestType) => { + setSelectedTab(newIouType); + resetIOUTypeIfChanged(newIouType); + }, + [resetIOUTypeIfChanged], + ); + // Clear out the temporary expense if the reportID in the URL has changed from the transaction's reportID. useFocusEffect( useCallback(() => { @@ -253,10 +261,7 @@ function IOURequestStartPage({ { - setSelectedTab(newIouType); - resetIOUTypeIfChanged(newIouType); - }} + onTabSelected={onTabSelected} tabBar={TabSelector} onTabBarFocusTrapContainerElementChanged={setTabBarContainerElement} onActiveTabFocusTrapContainerElementChanged={setActiveTabContainerElement}