fix: currentPlan checks in buckets.

This commit is contained in:
Darshan committed 2025-04-02 13:20:15 +05:30
1 parent ddf52b8899
commit bac6387885
2 files changed
+5 -2

No files matched your search

@@ -1,9 +1,12 @@
import type { PageLoad } from './$types';
import { sdk } from '$lib/stores/sdk';
import { isCloud } from '$lib/system';
export const load: PageLoad = async ({ parent }) => {
const { organization } = await parent();
const currentPlan = await sdk.forConsole.billing.getOrganizationPlan(organization.$id);
const currentPlan = isCloud
? await sdk.forConsole.billing.getOrganizationPlan(organization.$id)
: null;
return {
currentPlan
};
@@ -13,7 +13,7 @@
import type { Plan } from '$lib/sdk/billing';
export let currentPlan: Plan;
const service = currentPlan['fileSize'];
const service = currentPlan?.['fileSize'];
const { value, unit, baseValue, units } = createByteUnitPair($bucket.maximumFileSize, 1000);
const options = units.map((v) => ({ label: v.name, value: v.name }));
$: selectedUnit = $unit;