diff options
Diffstat (limited to 'app/client/modules/samplernn/samplernn.reducer.js')
| -rw-r--r-- | app/client/modules/samplernn/samplernn.reducer.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/app/client/modules/samplernn/samplernn.reducer.js b/app/client/modules/samplernn/samplernn.reducer.js index 4b4b93e..c271407 100644 --- a/app/client/modules/samplernn/samplernn.reducer.js +++ b/app/client/modules/samplernn/samplernn.reducer.js @@ -60,19 +60,19 @@ const samplernnReducer = (state = samplernnInitialState, action) => { return state case types.file.create: - case types.folder.upload_complete: if (action.data.module === 'samplernn') { console.log(action.data) let dataset, old_dataset, folder, old_folder const dataset_name = action.data.name.split('.')[0] - if (dataset_name in state.data.datasets) { - old_dataset = state.data.datasets[dataset_name] + if (dataset_name in state.data.datasetLookup) { + old_dataset = state.data.datasetLookup[dataset_name] dataset = { ...old_dataset, input: action.data.generated ? old_dataset.input : [action.data.id].concat(old_dataset.input), output: !action.data.generated ? old_dataset.output : [action.data.id].concat(old_dataset.output), } } else { + console.log(action.data.created_at, action.data.date) dataset = { name: dataset_name, date: action.data.created_at || action.data.date, @@ -84,7 +84,8 @@ const samplernnReducer = (state = samplernnInitialState, action) => { old_folder = state.data.folderLookup[action.data.folder_id] folder = { ...old_folder, - files: old_folder.files.concat([action.data.id]) + datasets: old_folder.datasets.concat([dataset_name]), + files: old_folder.files.concat([action.data.id]), } return { ...state, |
