Skip to content
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
4 changes: 3 additions & 1 deletion src/pages/iou/request/step/IOURequestStepDistance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import type {BaseTextInputRef} from '@components/TextInput/BaseTextInput/types';
import withCurrentUserPersonalDetails from '@components/withCurrentUserPersonalDetails';
import type {WithCurrentUserPersonalDetailsProps} from '@components/withCurrentUserPersonalDetails';
import useDefaultExpensePolicy from '@hooks/useDefaultExpensePolicy';
import useEnvironment from '@hooks/useEnvironment';
import useFetchRoute from '@hooks/useFetchRoute';
import useLocalize from '@hooks/useLocalize';
import useNetwork from '@hooks/useNetwork';
Expand Down Expand Up @@ -81,6 +82,7 @@ function IOURequestStepDistance({
const {isOffline} = useNetwork();
const {translate} = useLocalize();
const {isBetaEnabled} = usePermissions();
const {isProduction} = useEnvironment();
const isArchived = useReportIsArchived(report?.reportID);
const [parentReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${getNonEmptyStringOnyxID(report?.parentReportID)}`);
const [parentReportNextStep] = useOnyx(`${ONYXKEYS.COLLECTION.NEXT_STEP}${getNonEmptyStringOnyxID(report?.parentReportID)}`);
Expand Down Expand Up @@ -753,7 +755,7 @@ function IOURequestStepDistance({
[currentDistance, distanceUnit, submitManualDistance, manualFormError, handleManualInputChange],
);

if (isEditing) {
if (isEditing && !isProduction) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve waypoint guard when bypassing edit tabs

When isEditing is true in production, this new condition skips the edit-only return block and falls through to the generic map render path, which no longer applies the !currentTransaction?.comment?.waypoints not-found check. That means edit-distance routes with missing waypoints (e.g., malformed/deep-linked edit URLs or non-route distance transactions) now render a fresh map state instead of being rejected, allowing unintended edits to proceed in production.

Useful? React with 👍 / 👎.

return (
<StepScreenWrapper
headerTitle={translate('common.distance')}
Expand Down
Loading