From 5afbb7b99dbc0eb1a0f6810a1d5243283f85d087 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Mon, 24 Mar 2025 14:52:27 +0100 Subject: [PATCH] Pass bucket prop to UpdateMaxFileSize component --- .../storage/bucket-[bucket]/settings/+page.svelte | 2 +- .../bucket-[bucket]/settings/updateMaxFileSize.svelte | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/routes/(console)/project-[project]/storage/bucket-[bucket]/settings/+page.svelte b/src/routes/(console)/project-[project]/storage/bucket-[bucket]/settings/+page.svelte index 6dc7b884d..cf7c34775 100644 --- a/src/routes/(console)/project-[project]/storage/bucket-[bucket]/settings/+page.svelte +++ b/src/routes/(console)/project-[project]/storage/bucket-[bucket]/settings/+page.svelte @@ -367,7 +367,7 @@ - +
diff --git a/src/routes/(console)/project-[project]/storage/bucket-[bucket]/settings/updateMaxFileSize.svelte b/src/routes/(console)/project-[project]/storage/bucket-[bucket]/settings/updateMaxFileSize.svelte index 3cc163434..d3b186c46 100644 --- a/src/routes/(console)/project-[project]/storage/bucket-[bucket]/settings/updateMaxFileSize.svelte +++ b/src/routes/(console)/project-[project]/storage/bucket-[bucket]/settings/updateMaxFileSize.svelte @@ -8,13 +8,15 @@ import { readOnly, upgradeURL } from '$lib/stores/billing'; import { organization } from '$lib/stores/organization'; import { GRACE_PERIOD_OVERRIDE, isCloud } from '$lib/system'; - import { bucket } from '../store'; import { updateBucket } from './+page.svelte'; import type { Plan } from '$lib/sdk/billing'; + import type { Models } from '@appwrite.io/console'; + + export let bucket: Models.Bucket; export let currentPlan: Plan | null; const service = currentPlan ? currentPlan['fileSize'] : null; - const { value, unit, baseValue, units } = createByteUnitPair($bucket.maximumFileSize, 1000); + const { value, unit, baseValue, units } = createByteUnitPair(bucket.maximumFileSize, 1000); const options = units.map((v) => ({ label: v.name, value: v.name })); $: selectedUnit = $unit; @@ -24,6 +26,7 @@ function updateMaxSize() { updateBucket( + bucket, { maximumFileSize: $baseValue }, @@ -72,7 +75,7 @@ id="size" label="Size" disabled={$readOnly && !GRACE_PERIOD_OVERRIDE} - placeholder={$bucket.maximumFileSize.toString()} + placeholder={bucket.maximumFileSize.toString()} min={0} max={isCloud ? maxValue() : Infinity} bind:value={$value} /> @@ -81,7 +84,7 @@