Skip to content

Commit 579b7c7

Browse files
authored
Merge branch 'develop' into fixes#2246
2 parents 690a7e3 + 71984a9 commit 579b7c7

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

client/modules/IDE/actions/assets.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@ export function getAssets() {
1010
dispatch(startLoader());
1111
try {
1212
const response = await apiClient.get('/S3/objects');
13-
dispatch(setAssets(response.data.assets, response.data.totalSize));
13+
14+
const assetData = {
15+
assets: response.data.assets,
16+
totalSize: response.data.totalSize
17+
};
18+
19+
dispatch(setAssets(assetData));
1420
dispatch(stopLoader());
1521
} catch (error) {
1622
dispatch({

client/modules/IDE/reducers/assets.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ const assetsSlice = createSlice({
99
name: 'assets',
1010
initialState,
1111
reducers: {
12-
setAssets: (state, action) => action.payload,
12+
setAssets: (state, action) => {
13+
state.list = action.payload.assets;
14+
state.totalSize = action.payload.totalSize;
15+
},
1316
deleteAsset: (state, action) => {
1417
const key = action.payload;
1518
const index = state.list.findIndex((asset) => asset.key === key);

0 commit comments

Comments
 (0)