don't allow more than 100% usage

This commit is contained in:
Abhinav 2022-12-16 15:13:10 +05:30
parent 4a53834062
commit bc513978b7
2 changed files with 3 additions and 3 deletions

View file

@ -16,7 +16,7 @@ export function FamilyUsageProgressBar({
<Box position={'relative'} width="100%">
<Progressbar
sx={{ backgroundColor: 'transparent' }}
value={(userUsage * 100) / totalStorage}
value={Math.min((userUsage * 100) / totalStorage, 100)}
/>
<Progressbar
sx={{
@ -28,7 +28,7 @@ export function FamilyUsageProgressBar({
},
width: '100%',
}}
value={(totalUsage * 100) / totalStorage}
value={Math.min((totalUsage * 100) / totalStorage, 100)}
/>
</Box>
);

View file

@ -13,7 +13,7 @@ interface Iprops {
export function IndividualUsageSection({ usage, storage, fileCount }: Iprops) {
return (
<Box width="100%">
<Progressbar value={(usage * 100) / storage} />
<Progressbar value={Math.min((usage * 100) / storage, 100)} />
<SpaceBetweenFlex
sx={{
marginTop: 1.5,