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

refactor(organizations): simplify shouldUseTeamLabel #5294

Merged
merged 1 commit into from
Nov 21, 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
12 changes: 4 additions & 8 deletions jsapp/js/account/organization/organization.utils.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type {SubscriptionInfo} from 'jsapp/js/account/stripe.types';
import type {EnvStoreData} from 'jsapp/js/envStore';

/** Only use this directly for complex cases/strings (for example, possessive case).
/** Only use this directly for complex cases/strings (for example, possessive case).
* Otherwise, use getSimpleMMOLabel.
* @param {EnvStoreData} envStoreData
* @param {SubscriptionInfo} subscription
Expand All @@ -11,13 +11,9 @@ export function shouldUseTeamLabel(
envStoreData: EnvStoreData,
subscription: SubscriptionInfo | null
) {
if (subscription) {
return (
subscription.items[0].price.product.metadata?.use_team_label === 'true'
);
}

return envStoreData.use_team_label;
return subscription
? subscription.items[0].price.product.metadata?.use_team_label === 'true'
: envStoreData.use_team_label;
}

/**
Expand Down
Loading