fix: storage quota not shown with Stalwart #577

This commit is contained in:
Linus Rath
2026-07-07 20:35:37 +02:00
parent 9930d19ba4
commit db2c642d74
5 changed files with 17 additions and 6 deletions
+2 -1
View File
@@ -91,7 +91,8 @@ function StorageQuotaCircle({ quota, usagePercent }: { quota: { used: number; to
return () => document.removeEventListener("mousedown", handleClick);
}, [open, updatePosition]);
const free = quota.total - quota.used;
// Usage can legitimately exceed the quota (e.g. limit lowered after the fact)
const free = Math.max(0, quota.total - quota.used);
const strokeColor = usagePercent > 90
? "stroke-destructive"
: usagePercent > 70