diff --git a/web/src/css/dropdown.less b/web/src/css/dropdown.less index 663373b3f..ba8442df3 100644 --- a/web/src/css/dropdown.less +++ b/web/src/css/dropdown.less @@ -1,4 +1,4 @@ -hr .divider { +hr.divider { margin-top: 5px; margin-bottom: 5px; } diff --git a/web/src/js/ducks/flows.js b/web/src/js/ducks/flows.js index 913d0881c..404db0d18 100644 --- a/web/src/js/ducks/flows.js +++ b/web/src/js/ducks/flows.js @@ -1,5 +1,6 @@ import { fetchApi } from '../utils' import reduceList, * as listActions from './utils/list' +import { selectRelative } from './flowView' import * as msgQueueActions from './msgQueue' import * as websocketActions from './websocket' @@ -210,8 +211,14 @@ export function updateFlow(item) { * @private */ export function removeFlow(id) { - return (dispatch) => { - dispatch(select()) + return (dispatch, getState) => { + let currentIndex = getState().flowView.indexOf[getState().flows.selected[0]] + let maxIndex = getState().flowView.data.length - 1 + let deleteLastEntry = maxIndex == 0 + if (deleteLastEntry) + dispatch(select()) + else + dispatch(selectRelative(currentIndex == maxIndex ? -1 : 1) ) dispatch({ type: REMOVE, id }) } }