Skip to content

Commit a276a36

Browse files
committed
fix: use current asset total in usage meter
1 parent 19778f5 commit a276a36

3 files changed

Lines changed: 3 additions & 5 deletions

File tree

client/modules/IDE/components/AssetSize.jsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ const formatPercent = (percent) => {
2121
const AssetSize = () => {
2222
const { t } = useTranslation();
2323

24-
const totalSize = useSelector(
25-
(state) => state.user.totalSize || state.assets.totalSize
26-
);
24+
const totalSize = useSelector((state) => state.assets.totalSize);
2725

2826
if (totalSize === undefined) {
2927
return null;

client/modules/IDE/reducers/assets.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { createSlice } from '@reduxjs/toolkit';
22

33
const initialState = {
44
list: [],
5-
totalSize: 0
5+
totalSize: undefined
66
};
77

88
const assetsSlice = createSlice({

client/modules/IDE/selectors/users.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const getreachedTotalSizeLimit = createSelector(
2626
getTotalSize,
2727
getAssetsTotalSize,
2828
(totalSize, assetsTotalSize) => {
29-
const currentSize = totalSize || assetsTotalSize || 0;
29+
const currentSize = assetsTotalSize ?? totalSize ?? 0;
3030
if (currentSize >= limit) return true;
3131
// if (totalSize > 1000) return true;
3232
return false;

0 commit comments

Comments
 (0)