Skip to content

Commit 5dd8183

Browse files
copilot fix
1 parent 2f37304 commit 5dd8183

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/utils/disks/prepareDisks.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ export function prepareVDiskSizeFields({
153153
SlotSize: string | number | undefined;
154154
}) {
155155
const available = Number(AvailableSize ?? 0);
156+
// Unlike available, allocated is displayed in UI, it is incorrect to fallback it to 0
156157
const allocated = Number(AllocatedSize);
157158
const slotSize = Number(SlotSize);
158159

@@ -163,7 +164,7 @@ export function prepareVDiskSizeFields({
163164
sizeLimit = slotSize;
164165
}
165166

166-
const allocatedPercent = Math.floor((allocated * 100) / sizeLimit);
167+
const allocatedPercent = sizeLimit > 0 ? Math.floor((allocated * 100) / sizeLimit) : NaN;
167168

168169
return {
169170
AvailableSize: available,

0 commit comments

Comments
 (0)