Skip to content
Merged
Show file tree
Hide file tree
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: 2 additions & 2 deletions src/libs/actions/Policy/PerDiem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function generateCustomUnitID(): string {
return NumberUtils.generateHexadecimalValue(13);
}

function enablePerDiem(policyID: string, enabled: boolean, customUnitID?: string) {
function enablePerDiem(policyID: string, enabled: boolean, customUnitID?: string, disableRedirect?: boolean) {
const doesCustomUnitExists = !!customUnitID;
const finalCustomUnitID = doesCustomUnitExists ? customUnitID : generateCustomUnitID();
const optimisticCustomUnit = {
Expand Down Expand Up @@ -104,7 +104,7 @@ function enablePerDiem(policyID: string, enabled: boolean, customUnitID?: string

API.write(WRITE_COMMANDS.TOGGLE_POLICY_PER_DIEM, parameters, onyxData);

if (enabled && getIsNarrowLayout()) {
if (enabled && getIsNarrowLayout() && !disableRedirect) {
navigateWhenEnableFeature(policyID);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/workspace/upgrade/WorkspaceUpgradePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function WorkspaceUpgradePage({route}: WorkspaceUpgradePageProps) {
Policy.enableCompanyCards(policyID, true, true);
break;
case CONST.UPGRADE_FEATURE_INTRO_MAPPING.perDiem.id:
PerDiem.enablePerDiem(policyID, true, perDiemCustomUnit?.customUnitID);
PerDiem.enablePerDiem(policyID, true, perDiemCustomUnit?.customUnitID, true);
break;
default:
}
Expand Down