diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-05-30 14:37:03 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-05-30 14:37:03 +0200 |
| commit | cba34c1ff3fc4fa3e4444884133a9140443bb233 (patch) | |
| tree | 25858c5f4ac48d0fe9d1dbd238f719b4152f4e9c /app/client/modules/samplernn/samplernn.reducer.js | |
| parent | 400f5c15bcbdae2aef1a4aa0ca5e518ebffc2ad7 (diff) | |
parse urls using the old parser
Diffstat (limited to 'app/client/modules/samplernn/samplernn.reducer.js')
| -rw-r--r-- | app/client/modules/samplernn/samplernn.reducer.js | 47 |
1 files changed, 34 insertions, 13 deletions
diff --git a/app/client/modules/samplernn/samplernn.reducer.js b/app/client/modules/samplernn/samplernn.reducer.js index ba429ee..efd31f5 100644 --- a/app/client/modules/samplernn/samplernn.reducer.js +++ b/app/client/modules/samplernn/samplernn.reducer.js @@ -8,8 +8,8 @@ const samplernnInitialState = { files: [], results: [], upload: { - loading: true, - status: 'Loading...', + loading: false, + status: '', }, } @@ -28,29 +28,21 @@ const samplernnReducer = (state = samplernnInitialState, action) => { return { ...state, } + case types.folder.index: - console.log(action) return { ...state, folders: action.data, folder: action.data[0], } case types.folder.update: - console.log(action) return state case types.file.index: - console.log(action) return { ...state, files: action.data } - case types.file.create: - console.log(action) - return { - ...state, - files: [action.data].concat(this.files) - } - return + case types.folder.upload_loading: return { ...state, @@ -85,14 +77,43 @@ const samplernnReducer = (state = samplernnInitialState, action) => { status: 'Waiting for server to finish processing...', }, } + case types.file.create_loading: + return { + ...state, + upload: { + loading: true, + status: 'Creating file...' + } + } + case types.file.create: + console.log('booo') + if (state.folder.id === action.data.folder_id) { + return { + ...state, + files: [action.data].concat(state.files), + upload: { + loading: false, + status: 'File created', + }, + } + } else { + return { + ...state, + upload: { + loading: false, + status: 'created', + }, + } + } case types.folder.upload_complete: console.log(action) if (state.folder.id === action.folder) { return { ...state, - files: state.files.concat(state.file), // sort here also + files: [action.files].concat(state.files), upload: { loading: false, + status: 'Upload complete', }, } } else { |
