From 746c9f9399487ece15c369c4dd9e3388d415c22c Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 5 Jun 2018 21:03:31 +0200 Subject: separate dataset stuff from samplernn stuff --- app/client/dataset/upload.reducer.js | 52 ++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 app/client/dataset/upload.reducer.js (limited to 'app/client/dataset/upload.reducer.js') diff --git a/app/client/dataset/upload.reducer.js b/app/client/dataset/upload.reducer.js new file mode 100644 index 0000000..e28a18e --- /dev/null +++ b/app/client/dataset/upload.reducer.js @@ -0,0 +1,52 @@ +import types from '../types' + +const uploadInitialState = { + loading: false, + error: null, + status: '', +} + +const uploadReducer = (state = uploadInitialState, action) => { + switch(action.type) { + case types.folder.upload_loading: + return { + error: null, + loading: true, + status: 'Loading...', + } + case types.folder.upload_error: + return { + error: null, + loading: false, + status: 'Error uploading :(', + } + case types.folder.upload_progress: + return { + error: null, + loading: true, + status: 'Upload progress ' + action.percent + '%', + } + case types.folder.upload_waiting: + return { + error: null, + loading: true, + status: 'Waiting for server to finish processing...', + } + case types.folder.upload_complete: + return { + error: null, + loading: false, + status: 'Upload complete', + } + case types.file.create_loading: + return { + error: null, + loading: true, + status: 'Creating file...' + } + default: + return state + } +} + +export default uploadReducer -- cgit v1.2.3-70-g09d2