Fix components not being unmounted on page hide

This commit is contained in:
Bill Thornton
2025-06-03 17:31:46 -04:00
parent afb1f9570d
commit b705cfc4c3
3 changed files with 19 additions and 11 deletions
@@ -22,13 +22,13 @@ interface StorageListItemProps {
const calculateUsed = (folder?: FolderStorageDto) => {
if (typeof folder?.UsedSpace === 'undefined') return 0;
if (typeof folder.FreeSpace === 'undefined') return 100;
const totalSpace = folder.FreeSpace + folder.UsedSpace;
if (totalSpace === 0) return 0;
// Ensure we don't have negative values
const usedSpace = Math.max(0, folder.UsedSpace);
return Math.min(100, (usedSpace / totalSpace) * 100);
};