From 4962b8e44bd6cb160645cb12c48f7196f84dc5aa Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Wed, 27 Nov 2024 15:11:23 +0800 Subject: [PATCH 1/3] fix skip confirmiaton is true for manual split --- src/pages/iou/request/step/IOURequestStepAmount.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/iou/request/step/IOURequestStepAmount.tsx b/src/pages/iou/request/step/IOURequestStepAmount.tsx index 72a931bf359c..03850aa130dd 100644 --- a/src/pages/iou/request/step/IOURequestStepAmount.tsx +++ b/src/pages/iou/request/step/IOURequestStepAmount.tsx @@ -76,12 +76,12 @@ function IOURequestStepAmount({ // For quick button actions, we'll skip the confirmation page unless the report is archived or this is a workspace request, as // the user will have to add a merchant. const shouldSkipConfirmation: boolean = useMemo(() => { - if (!skipConfirmation || !report?.reportID) { + if (isSplitBill || !skipConfirmation || !report?.reportID) { return false; } return !(ReportUtils.isArchivedRoom(report, reportNameValuePairs) || ReportUtils.isPolicyExpenseChat(report)); - }, [report, skipConfirmation, reportNameValuePairs]); + }, [report, isSplitBill, skipConfirmation, reportNameValuePairs]); useFocusEffect( useCallback(() => { From 0a2ef8edc2d3244af2767518542286f3b6bd8637 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Wed, 27 Nov 2024 15:11:37 +0800 Subject: [PATCH 2/3] remove unnecessary logic --- .../iou/request/step/IOURequestStepAmount.tsx | 21 ------------------- 1 file changed, 21 deletions(-) diff --git a/src/pages/iou/request/step/IOURequestStepAmount.tsx b/src/pages/iou/request/step/IOURequestStepAmount.tsx index 03850aa130dd..2b3d639deaa9 100644 --- a/src/pages/iou/request/step/IOURequestStepAmount.tsx +++ b/src/pages/iou/request/step/IOURequestStepAmount.tsx @@ -178,27 +178,6 @@ function IOURequestStepAmount({ const backendAmount = CurrencyUtils.convertToBackendAmount(Number.parseFloat(amount)); if (shouldSkipConfirmation) { - // Only skip confirmation when the split is not configurable, for now Smartscanned splits cannot be configured - if (iouType === CONST.IOU.TYPE.SPLIT && transaction?.iouRequestType === CONST.IOU.REQUEST_TYPE.SCAN) { - playSound(SOUNDS.DONE); - IOU.splitBill({ - participants, - currentUserLogin: currentUserPersonalDetails.login ?? '', - currentUserAccountID: currentUserPersonalDetails.accountID, - amount: backendAmount, - comment: '', - currency, - merchant: CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT, - tag: '', - category: '', - created: transaction?.created ?? '', - billable: false, - iouRequestType: CONST.IOU.REQUEST_TYPE.MANUAL, - existingSplitChatReportID: report?.reportID, - }); - return; - } - if (iouType === CONST.IOU.TYPE.PAY || iouType === CONST.IOU.TYPE.SEND) { if (paymentMethod && paymentMethod === CONST.IOU.PAYMENT_TYPE.EXPENSIFY) { IOU.sendMoneyWithWallet(report, backendAmount, currency, '', currentUserPersonalDetails.accountID, participants.at(0) ?? {}); From 73d5a29bac592eefead21eb7de6ffbb28f13f961 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Sat, 30 Nov 2024 10:02:56 +0800 Subject: [PATCH 3/3] fix split scan QAB isn't skipped after switch tab from split distance QAB --- .../sidebar/SidebarScreen/FloatingActionButtonAndPopover.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.tsx b/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.tsx index f0e8d2ba1781..d36003960fe4 100644 --- a/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.tsx +++ b/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.tsx @@ -267,10 +267,8 @@ function FloatingActionButtonAndPopover({onHideCreateMenu, onShowCreateMenu}: Fl return; case CONST.QUICK_ACTIONS.SPLIT_MANUAL: case CONST.QUICK_ACTIONS.SPLIT_SCAN: - selectOption(() => IOU.startMoneyRequest(CONST.IOU.TYPE.SPLIT, quickActionReportID, undefined, true), true); - return; case CONST.QUICK_ACTIONS.SPLIT_DISTANCE: - selectOption(() => IOU.startMoneyRequest(CONST.IOU.TYPE.SPLIT, quickActionReportID, undefined, false), true); + selectOption(() => IOU.startMoneyRequest(CONST.IOU.TYPE.SPLIT, quickActionReportID, undefined, true), true); return; case CONST.QUICK_ACTIONS.SEND_MONEY: selectOption(() => IOU.startMoneyRequest(CONST.IOU.TYPE.PAY, quickActionReportID, undefined, true), false);