diff options
| author | lens <lens@neural.garden> | 2021-03-23 21:10:11 +0000 |
|---|---|---|
| committer | lens <lens@neural.garden> | 2021-03-23 21:10:11 +0000 |
| commit | cc1d0c52e104245f9f1c0d77eb24a5a33800be38 (patch) | |
| tree | 02d8483dfe47803525b926a43c582dcfbf61c5db /frontend/app/views/graph/graph.reducer.js | |
| parent | 81c673f058fda04b96baae7b2302f876479bc0a9 (diff) | |
| parent | 7a3ec205e001e4c071a67ecc5c375612fa72afdc (diff) | |
Merge branch 'master' of asdf.us:swimmer
Diffstat (limited to 'frontend/app/views/graph/graph.reducer.js')
| -rw-r--r-- | frontend/app/views/graph/graph.reducer.js | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/frontend/app/views/graph/graph.reducer.js b/frontend/app/views/graph/graph.reducer.js index 6be5089..725c256 100644 --- a/frontend/app/views/graph/graph.reducer.js +++ b/frontend/app/views/graph/graph.reducer.js @@ -7,6 +7,8 @@ const initialState = crudState('graph', { editor: { addingPage: false, editingPage: false, + showingAudio: false, + building: false, }, options: { } @@ -36,6 +38,19 @@ export default function graphReducer(state = initialState, action) { } } + case types.upload.upload_complete: + console.log(action) + return { + ...state, + show: { + ...state.show, + res: { + ...state.show.res, + uploads: state.show.res.uploads.concat(action.data.res) + } + } + } + case types.graph.show_add_page_form: return { ...state, @@ -43,6 +58,7 @@ export default function graphReducer(state = initialState, action) { ...state.editor, addingPage: true, editingPage: false, + showingAudio: false, } } @@ -52,6 +68,7 @@ export default function graphReducer(state = initialState, action) { editor: { ...state.editor, addingPage: false, + showingAudio: false, } } @@ -62,6 +79,7 @@ export default function graphReducer(state = initialState, action) { ...state.editor, addingPage: !state.editor.addingPage, editingPage: false, + showingAudio: false, } } @@ -72,6 +90,7 @@ export default function graphReducer(state = initialState, action) { ...state.editor, addingPage: false, editingPage: true, + showingAudio: false, } } @@ -81,6 +100,7 @@ export default function graphReducer(state = initialState, action) { editor: { ...state.editor, editingPage: false, + showingAudio: false, } } @@ -91,9 +111,34 @@ export default function graphReducer(state = initialState, action) { ...state.editor, addingPage: false, editingPage: !state.editor.editingPage, + showingAudio: false, } } + case types.graph.toggle_audio_list: + return { + ...state, + editor: { + ...state.editor, + addingPage: false, + editingPage: false, + showingAudio: !state.editor.showingAudio, + } + } + + case types.api.loading: + if (action.tag !== 'view' && action.tag !== 'export') { + return state + } + return { ...state, editor: { ...state.editor, building: action.tag } } + + case types.api.loaded: + case types.api.error: + if (action.tag !== 'view' && action.tag !== 'export') { + return state + } + return { ...state, editor: { ...state.editor, building: null } } + default: return state } |
