Skip to content

Commit

Permalink
Merge pull request #52295 from truph01/fix/52201
Browse files Browse the repository at this point in the history
fix: View your subscription link opens Subscription page then back to workspace
  • Loading branch information
carlosmiceli authored Nov 11, 2024
2 parents 62ae851 + 23fab23 commit b08ea70
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
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

0 comments on commit b08ea70

Please sign in to comment.