Add topic filter
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
import { ActionTypes, CustomAction, AppState } from '../reducers'
|
||||
import { AppState } from '../reducers'
|
||||
import { ActionTypes } from '../reducers/Tree'
|
||||
import * as q from '../../../backend/src/Model'
|
||||
import { Dispatch } from 'redux'
|
||||
import { setTopic } from './Publish'
|
||||
|
||||
export const selectTopic = (topic: q.TreeNode) => (dispatch: Dispatch<any>, getState: () => AppState) => {
|
||||
const { selectedTopic } = getState().tooBigReducer
|
||||
const { selectedTopic } = getState().tree
|
||||
|
||||
// Update publish topic
|
||||
if (selectedTopic && (selectedTopic.path() === getState().publish.topic || !getState().publish.topic)) {
|
||||
@@ -13,6 +14,13 @@ export const selectTopic = (topic: q.TreeNode) => (dispatch: Dispatch<any>, getS
|
||||
|
||||
dispatch({
|
||||
selectedTopic: topic,
|
||||
type: ActionTypes.selectTopic,
|
||||
type: ActionTypes.TREE_SELECT_TOPIC,
|
||||
})
|
||||
}
|
||||
|
||||
export const showTree = (tree?: q.Tree) => {
|
||||
return {
|
||||
tree,
|
||||
type: ActionTypes.TREE_SHOW_TREE,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user