fix(user_store): add a work around for calculating used space

This commit is contained in:
hexxa 2022-02-27 12:53:17 +08:00 committed by Hexxa
parent 73a6dfe4ae
commit e43ea8507c
2 changed files with 13 additions and 2 deletions

View file

@ -897,13 +897,21 @@ export class FilesPanel extends React.Component<Props, State, {}> {
);
const usedSpace = FileSize(
parseInt(this.props.login.extInfo.usedSpace, 10),
// TODO: this a work around before transaction is introduced
Math.trunc(
parseInt(this.props.login.extInfo.usedSpace, 10) / (1024 * 1024)
) *
(1024 * 1024),
{
round: 0,
}
);
const spaceLimit = FileSize(
parseInt(this.props.login.quota.spaceLimit, 10),
// TODO: this a work around before transaction is introduced
Math.trunc(
parseInt(this.props.login.quota.spaceLimit, 10) / (1024 * 1024)
) *
(1024 * 1024),
{
round: 0,
}