Deselect message history message when topic selection changes

Fixes #93
This commit is contained in:
Thomas Nordquist
2019-04-15 16:45:58 +02:00
parent d24dc41024
commit 38819b0e0a
5 changed files with 70 additions and 10 deletions

View File

@@ -1,5 +1,6 @@
import * as q from '../../../backend/src/Model'
import { ActionTypes } from '../reducers/Tree'
import { ActionTypes as SidebarActionTypes } from '../reducers/Sidebar'
import { AnyAction, Dispatch } from 'redux'
import { AppState } from '../reducers'
import { batchActions } from 'redux-batched-actions'
@@ -40,6 +41,11 @@ const debouncedSelectTopic = debounce((topic: q.TreeNode<TopicViewModel>, dispat
type: ActionTypes.TREE_SELECT_TOPIC,
}
dispatch({
type: SidebarActionTypes.SIDEBAR_SET_COMPARE_MESSAGE,
message: undefined,
})
if (setTopicDispatch) {
dispatch(batchActions([selectTreeTopicDispatch, setTopicDispatch]))
} else {