Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Allow location modal is shown briefly when navigating back from receipt preview #57164

Merged
merged 1 commit into from
Feb 25, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/pages/iou/request/step/IOURequestStepConfirmation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {isLocalFile as isLocalFileFileUtils} from '@libs/fileDownload/FileUtils'
import getCurrentPosition from '@libs/getCurrentPosition';
import {isMovingTransactionFromTrackExpense as isMovingTransactionFromTrackExpenseIOUUtils, navigateToStartMoneyRequestStep, shouldUseTransactionDraft} from '@libs/IOUUtils';
import Log from '@libs/Log';
import navigateAfterInteraction from '@libs/Navigation/navigateAfterInteraction';
import Navigation from '@libs/Navigation/Navigation';
import {getParticipantsOption, getReportOption} from '@libs/OptionsListUtils';
import {generateReportID, getBankAccountRoute} from '@libs/ReportUtils';
Expand Down Expand Up @@ -750,10 +751,16 @@ function IOURequestStepConfirmation({
<LocationPermissionModal
startPermissionFlow={startLocationPermissionFlow}
resetPermissionFlow={() => setStartLocationPermissionFlow(false)}
onGrant={() => createTransaction(selectedParticipantList, true)}
onGrant={() => {
navigateAfterInteraction(() => {
createTransaction(selectedParticipantList, true);
});
}}
onDeny={() => {
updateLastLocationPermissionPrompt();
createTransaction(selectedParticipantList, false);
navigateAfterInteraction(() => {
createTransaction(selectedParticipantList, false);
});
}}
/>
)}
Expand Down