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

fix: View your subscription link opens Subscription page then back to workspace #52295

Merged
merged 1 commit into from
Nov 11, 2024
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
Loading