diff options
Diffstat (limited to 'animism-align/frontend/app/views/align/align.actions.js')
| -rw-r--r-- | animism-align/frontend/app/views/align/align.actions.js | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/animism-align/frontend/app/views/align/align.actions.js b/animism-align/frontend/app/views/align/align.actions.js index 6074b34..6eca0a7 100644 --- a/animism-align/frontend/app/views/align/align.actions.js +++ b/animism-align/frontend/app/views/align/align.actions.js @@ -1,13 +1,12 @@ import * as types from 'app/types' -import { store, history, dispatch } from 'app/store' -import { api } from 'app/utils' +import { store } from 'app/store' import actions from 'app/actions' // import { session } from 'app/session' import throttle from 'lodash.throttle' import debounce from 'lodash.debounce' import { ZOOM_STEPS } from 'app/constants' -import { getFirstPunctuationMarkIndex, cutFirstSentence } from 'app/utils/align.utils' +import { cutFirstSentence } from 'app/utils/align.utils' export const setScrollPosition = start_ts => dispatch => ( dispatch({ type: types.align.set_display_setting, key: 'start_ts', value: start_ts }) @@ -27,16 +26,16 @@ export const setCursor = cursor_ts => dispatch => ( ) export const setSelectedAnnotation = annotation => dispatch => { - dispatch({ type: types.align.set_selected_annotation, data: annotation }) debouncedUpdateAnnotation.flush() + dispatch({ type: types.align.set_selected_annotation, data: annotation }) } export const clearSelectedAnnotation = () => dispatch => { - dispatch({ type: types.align.clear_selected_annotation }) debouncedUpdateAnnotation.flush() + dispatch({ type: types.align.clear_selected_annotation }) } export const updateSelectedAnnotation = annotation => dispatch => { - dispatch({ type: types.align.set_selected_annotation, data: { ...annotation } }) debouncedUpdateAnnotation(annotation) + dispatch({ type: types.align.set_selected_annotation, data: { ...annotation } }) } export const debouncedUpdateAnnotation = debounce(annotation => { console.log('updating annotation', annotation) @@ -47,7 +46,7 @@ export const debouncedUpdateAnnotation = debounce(annotation => { export const setSelectedParagraph = paragraph_id => dispatch => { dispatch({ type: types.align.set_display_setting, key: 'selected_paragraph_id', value: paragraph_id }) } -export const clearSelectedParagraph = paragraph_id => dispatch => { +export const clearSelectedParagraph = () => dispatch => { dispatch({ type: types.align.set_display_setting, key: 'selected_paragraph_id', value: -1 }) } |
