diff --git a/src/libs/actions/Policy/PerDiem.ts b/src/libs/actions/Policy/PerDiem.ts index 2ce31fd4c921..1f6f0cf3dc9a 100644 --- a/src/libs/actions/Policy/PerDiem.ts +++ b/src/libs/actions/Policy/PerDiem.ts @@ -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 = { @@ -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); } } diff --git a/src/pages/workspace/upgrade/WorkspaceUpgradePage.tsx b/src/pages/workspace/upgrade/WorkspaceUpgradePage.tsx index d5ad6e7b4d1c..4cc26399034e 100644 --- a/src/pages/workspace/upgrade/WorkspaceUpgradePage.tsx +++ b/src/pages/workspace/upgrade/WorkspaceUpgradePage.tsx @@ -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: }