Change to ternary

This commit is contained in:
ernstmul
2024-12-23 14:27:39 +01:00
parent 01b4dd1d94
commit ef116a39d0
2 changed files with 5 additions and 5 deletions
+1
View File
@@ -25,6 +25,7 @@ export const load: LayoutLoad = async ({ fetch, depends, parent }) => {
let plansInfo = new Map<Tier, Plan>();
if (isCloud) {
const plansArray = await sdk.forConsole.billing.getPlansInfo();
console.log('plansArray', plansArray);
plansInfo = plansArray.plans.reduce((map, plan) => {
map.set(plan.$id as Tier, plan);
return map;
@@ -190,11 +190,10 @@
(team) => team.$id === selectedOrgId
) as Organization;
$: if (selectedOrg?.billingPlan === BillingPlan.SCALE) {
billingPlan = BillingPlan.SCALE;
} else if (campaign?.plan) {
billingPlan = campaign.plan;
}
$: billingPlan =
selectedOrg?.billingPlan === BillingPlan.SCALE
? BillingPlan.SCALE
: (campaign?.plan ?? BillingPlan.PRO);
</script>
<svelte:head>