diff --git a/src/app/api/storage-usage/route.ts b/src/app/api/storage-usage/route.ts index 56f0bcb..7a1e52b 100644 --- a/src/app/api/storage-usage/route.ts +++ b/src/app/api/storage-usage/route.ts @@ -11,12 +11,13 @@ export async function GET() { const familyId = auth.session!.familyId!; const info = await getStorageInfo(familyId); + // Both tiers now have a real cap (free 1 GB / premium 50 GB) — show actuals. return NextResponse.json({ usedBytes: info.usedBytes, - limitBytes: info.isPaid ? null : info.limitBytes, + limitBytes: info.limitBytes, usedFormatted: formatBytes(info.usedBytes), - limitFormatted: info.isPaid ? "Unlimited" : formatBytes(info.limitBytes), - fraction: info.isPaid ? 0 : info.fraction, + limitFormatted: formatBytes(info.limitBytes), + fraction: info.fraction, approaching: info.approaching, exceeded: info.exceeded, isPaid: info.isPaid, diff --git a/src/components/StorageMeter.tsx b/src/components/StorageMeter.tsx index 84933a0..0a9e2f2 100644 --- a/src/components/StorageMeter.tsx +++ b/src/components/StorageMeter.tsx @@ -40,7 +40,8 @@ export function StorageMeter({ info: propInfo, className = "", compact = false } ); } - if (!info || info.isPaid) return null; + // Show the meter for both free and premium — both now have a real cap. + if (!info) return null; if (compact && !info.approaching && !info.exceeded) return null; const pct = Math.min(info.fraction * 100, 100); @@ -84,7 +85,13 @@ export function StorageMeter({ info: propInfo, className = "", compact = false } {info.exceeded && (
New uploads are paused. Your existing memories are safe.{" "} - Upgrade or delete some memories to continue. + {info.isPaid ? ( + <>Delete some memories to free up space.> + ) : ( + <> + Upgrade or delete some memories to continue. + > + )}
)} {info.approaching && !info.exceeded && ( diff --git a/src/lib/quota.ts b/src/lib/quota.ts index 0f6399d..3548df7 100644 --- a/src/lib/quota.ts +++ b/src/lib/quota.ts @@ -21,6 +21,10 @@ export { formatBytes } from "@/lib/format-bytes"; export const FREE_STORAGE_LIMIT_BYTES = 1_073_741_824; // 1 GiB export const FREE_MEMBER_LIMIT = 2; +// Paid (premium) storage cap. Matches the seeded plan's storage grant (50 GiB). +// Kept here (not Infinity) so premium also has a ceiling and the meter shows X/50GB. +export const PAID_STORAGE_LIMIT_BYTES = 50 * 1_073_741_824; // 50 GiB + // Storage threshold at which we show a "approaching limit" nudge (80 %). export const STORAGE_WARN_THRESHOLD = 0.8; @@ -129,15 +133,15 @@ export async function getStorageInfo(familyId: string): Promise