Display full size when the user exceeds the limit"

This commit is contained in:
Arnaud 2024-09-23 17:05:20 +02:00
parent 3605aa3d4f
commit 78c344d9db
No known key found for this signature in database
GPG Key ID: 69D6CE281FCAE663

View File

@ -15,7 +15,10 @@ export function AvailabilitySpaceAllocation({ availability, space }: Props) {
const size = availability.totalSize * unit;
const isUpdating = !!availability.id;
const allocated = isUpdating ? quotaReservedBytes - size : quotaReservedBytes;
const remaining = quotaMaxBytes - allocated - size;
const remaining =
size > quotaMaxBytes - allocated
? quotaMaxBytes - allocated
: quotaMaxBytes - allocated - size;
const spaceData = [
{
@ -28,7 +31,7 @@ export function AvailabilitySpaceAllocation({ availability, space }: Props) {
},
{
title: "Remaining space",
size: remaining < 0 ? 0 : remaining,
size: remaining,
},
];