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

[CP Staging] fix: trip booking not navigate to T&C Page #49877

Merged
merged 2 commits into from
Sep 30, 2024
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/libs/TripReservationUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {isEmptyObject} from '@src/types/utils/EmptyObject';
import type IconAsset from '@src/types/utils/IconAsset';
import * as Link from './actions/Link';
import Navigation from './Navigation/Navigation';
import * as PolicyUtils from './PolicyUtils';

let travelSettings: OnyxEntry<TravelSettings>;
Onyx.connect({
Expand Down Expand Up @@ -78,7 +79,8 @@ function bookATrip(translate: LocaleContextProps['translate'], setCtaErrorMessag
setCtaErrorMessage(translate('travel.phoneError'));
return;
}
if (isEmptyObject(travelSettings)) {
const policy = PolicyUtils.getPolicy(activePolicyID);
if (isEmptyObject(policy?.address)) {
Navigation.navigate(ROUTES.WORKSPACE_PROFILE_ADDRESS.getRoute(activePolicyID ?? '-1', Navigation.getActiveRoute()));
return;
}
Expand Down
Loading