p5.js-web-editor/client/modules/IDE/reducers/assets.js
Cassie Tarakajian d64498ef1f
RE #168, Feature/asset totalsize limit (#1123)
* re #168, add totalsize to response from API, add loader to asset list, add totalsize to asset list ui

* re #168, add totalsize to response from API, add loader to asset list, add totalsize to asset list ui

* update asset list copy to remove limit, since that's not implemented yet
2019-07-24 12:55:58 -04:00

18 lines
421 B
JavaScript

import * as ActionTypes from '../../../constants';
// 1,000,000 bytes in a MB. can't upload if totalSize is bigger than this.
const initialState = {
list: [],
totalSize: 0
};
const assets = (state = initialState, action) => {
switch (action.type) {
case ActionTypes.SET_ASSETS:
return { list: action.assets, totalSize: action.totalSize };
default:
return state;
}
};
export default assets;