[web] fix selectFlows

This commit is contained in:
Jason 2016-06-25 00:53:56 +08:00
parent 571c817f21
commit 8da623c603
4 changed files with 9 additions and 7 deletions

View File

@ -29,6 +29,6 @@ function FlowMenu({ flow }) {
export default connect(
state => ({
flow: state.flows.list.data[state.flows.views.main.selected[0]],
flow: state.flows.list.byId[state.flows.views.main.selected[0]],
})
)(FlowMenu)

View File

@ -6,7 +6,7 @@ import { Key } from '../utils.js'
import Splitter from './common/Splitter'
import FlowTable from './FlowTable'
import FlowView from './FlowView'
import { selectFlow, updateFilter, updateHighlight } from '../ducks/views/main'
import { select as selectFlow, updateFilter, updateHighlight } from '../ducks/views/main'
class MainView extends Component {
@ -185,7 +185,7 @@ export default connect(
flows: state.flows.views.main.view.data,
filter: state.flows.views.main.filter,
highlight: state.flows.views.main.highlight,
selectedFlow: state.flows.list.data[state.flows.views.main.selected[0]]
selectedFlow: state.flows.list.byId[state.flows.views.main.selected[0]]
}),
{
selectFlow,

View File

@ -4,10 +4,10 @@ import * as msgQueueActions from './msgQueue'
export const MSG_TYPE = 'UPDATE_SETTINGS'
export const DATA_URL = '/settings'
export const RECEIVE = 'RECEIVE'
export const UPDATE = 'UPDATE'
export const RECEIVE = 'RECEIVE'
export const UPDATE = 'UPDATE'
export const REQUEST_UPDATE = 'REQUEST_UPDATE'
export const UNKNOWN_CMD = 'SETTINGS_UNKNOWN_CMD'
export const UNKNOWN_CMD = 'SETTINGS_UNKNOWN_CMD'
const defaultState = {
settings: {},

View File

@ -164,7 +164,9 @@ export function updateSorter(column, desc) {
* @public
*/
export function select(id) {
return { type: SELECT, currentSelection: getState().flows.views.main.selected[0], id }
return (dispatch, getState) => {
dispatch({ type: SELECT, currentSelection: getState().flows.views.main.selected[0], id })
}
}
/**