From 3fbc033e37476ff03fc4ad93145976faeea47934 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sun, 3 Jun 2018 16:34:09 +0200 Subject: reload the whole page. easier --- app/client/modules/samplernn/samplernn.reducer.js | 33 +++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) (limited to 'app/client/modules/samplernn/samplernn.reducer.js') diff --git a/app/client/modules/samplernn/samplernn.reducer.js b/app/client/modules/samplernn/samplernn.reducer.js index 372b3bc..524d650 100644 --- a/app/client/modules/samplernn/samplernn.reducer.js +++ b/app/client/modules/samplernn/samplernn.reducer.js @@ -17,34 +17,63 @@ const samplernnReducer = (state = samplernnInitialState, action) => { loading: false, data: action.data, } + case types.socket.connect: return { ...state, } + case types.task.task_begin: return { ...state, } + case types.task.task_finish: return { ...state, } + + case types.folder.create: + if (action.data.module === 'samplernn') { + return { + ...state, + loading: false, + // folder: { + // ...action.data, + // input: [], + // checkpoints: [], + // output: [], + // } + } + } + return state + case types.file.create: if (state.folder.id === action.data.folder_id) { return { ...state, - files: [action.data].concat(state.files), + loading: false, + folder: { + ...state.folder, + input: [action.data].concat(state.folder.input), + }, } } return state + case types.folder.upload_complete: if (state.folder.id === action.folder) { return { ...state, - files: [action.files].concat(state.files), + loading: false, + folder: { + ...state.folder, + input: [action.data].concat(state.folder.input), + }, } } return state + case types.socket.status: return samplernnSocket(state, action.data) -- cgit v1.2.3-70-g09d2