Skip to content

Commit cfdf2c4

Browse files
author
Nabi Ebrahimi
committed
fix: prevent "Not here" page opening in background when selecting Pay with Business BA in offline mode
1 parent 1f51f18 commit cfdf2c4

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

src/components/KYCWall/BaseKYCWall.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ function KYCWall({
171171
}
172172

173173
const lastWorkspaceNumber = lastWorkspaceNumberSelector(policies, currentUserEmail);
174-
const {policyID, workspaceChatReportID, reportPreviewReportActionID, adminsChatReportID} =
174+
const {policyID, workspaceChatReportID, adminsChatReportID} =
175175
createWorkspaceFromIOUPayment(
176176
iouReport,
177177
reportPreviewAction,
@@ -187,12 +187,11 @@ function KYCWall({
187187
savePreferredPaymentMethod(iouReport.policyID, policyID, CONST.LAST_PAYMENT_METHOD.IOU, lastPaymentMethod?.[iouReport?.policyID]);
188188
}
189189
completePaymentOnboarding(CONST.PAYMENT_SELECTED.BBA, introSelected, isSelfTourViewed, betas, adminsChatReportID, policyID);
190-
if (workspaceChatReportID) {
191-
Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(workspaceChatReportID, reportPreviewReportActionID));
192-
}
190+
const workspaceReportRoute = workspaceChatReportID ? ROUTES.REPORT_WITH_ID.getRoute(workspaceChatReportID) : undefined;
193191

194-
// Navigate to the bank account set up flow for this specific policy
195-
Navigation.navigate(ROUTES.BANK_ACCOUNT_WITH_STEP_TO_OPEN.getRoute({policyID}));
192+
setNavigationActionToMicrotaskQueue(() => {
193+
Navigation.navigate(ROUTES.BANK_ACCOUNT_WITH_STEP_TO_OPEN.getRoute({policyID, backTo: workspaceReportRoute}));
194+
});
196195
return;
197196
}
198197

0 commit comments

Comments
 (0)