import types from '../types' import moment from 'moment/min/moment.min' let FileSaver = require('file-saver') const browserInitialState = { loading: false, progress: null, error: null, data: {}, images: [ ], files: [ ] } const browserReducer = (state = browserInitialState, action) => { switch(action.type) { case types.app.load_progress: if (!action.data || action.data.module !== 'browser') { return state } return { ...state, loading: true, progress: action.progress, } case types.app.load: return { ...state, loading: false, error: null, data: action.data, } default: return state } } export default browserReducer