diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2021-04-01 15:31:52 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2021-04-01 15:31:52 +0200 |
| commit | 5cafa9d43b769e6f60740f59293ddf3588e7b8ad (patch) | |
| tree | a3d378cfbb91bec5c549e187e177a1fc327ef1fb /frontend/app/views/graph/graph.reducer.js | |
| parent | 8c733583739517ff453d561f3b8fc5ca0d334819 (diff) | |
migration: add settings to uploads. cursor upload
Diffstat (limited to 'frontend/app/views/graph/graph.reducer.js')
| -rw-r--r-- | frontend/app/views/graph/graph.reducer.js | 42 |
1 files changed, 25 insertions, 17 deletions
diff --git a/frontend/app/views/graph/graph.reducer.js b/frontend/app/views/graph/graph.reducer.js index 725c256..6a30a4e 100644 --- a/frontend/app/views/graph/graph.reducer.js +++ b/frontend/app/views/graph/graph.reducer.js @@ -3,11 +3,16 @@ import * as types from 'app/types' import { crudState, crudReducer } from 'app/api/crud.reducer' +const resetEditor = { + addingPage: false, + editingPage: false, + showingAudio: false, + showingCursors: false, +} + const initialState = crudState('graph', { editor: { - addingPage: false, - editingPage: false, - showingAudio: false, + ...resetEditor, building: false, }, options: { @@ -56,9 +61,8 @@ export default function graphReducer(state = initialState, action) { ...state, editor: { ...state.editor, + ...resetEditor, addingPage: true, - editingPage: false, - showingAudio: false, } } @@ -67,8 +71,7 @@ export default function graphReducer(state = initialState, action) { ...state, editor: { ...state.editor, - addingPage: false, - showingAudio: false, + ...resetEditor, } } @@ -77,9 +80,8 @@ export default function graphReducer(state = initialState, action) { ...state, editor: { ...state.editor, + ...resetEditor, addingPage: !state.editor.addingPage, - editingPage: false, - showingAudio: false, } } @@ -88,9 +90,8 @@ export default function graphReducer(state = initialState, action) { ...state, editor: { ...state.editor, - addingPage: false, + ...resetEditor, editingPage: true, - showingAudio: false, } } @@ -99,8 +100,7 @@ export default function graphReducer(state = initialState, action) { ...state, editor: { ...state.editor, - editingPage: false, - showingAudio: false, + ...resetEditor, } } @@ -109,9 +109,8 @@ export default function graphReducer(state = initialState, action) { ...state, editor: { ...state.editor, - addingPage: false, + ...resetEditor, editingPage: !state.editor.editingPage, - showingAudio: false, } } @@ -120,12 +119,21 @@ export default function graphReducer(state = initialState, action) { ...state, editor: { ...state.editor, - addingPage: false, - editingPage: false, + ...resetEditor, showingAudio: !state.editor.showingAudio, } } + case types.graph.toggle_cursor_list: + return { + ...state, + editor: { + ...state.editor, + ...resetEditor, + showingCursors: !state.editor.showingCursors, + } + } + case types.api.loading: if (action.tag !== 'view' && action.tag !== 'export') { return state |
