mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-06 19:51:39 +00:00
Close terminal on ESC has higher prio than search blur
This commit is contained in:
@@ -357,19 +357,21 @@ export function hitEsc() {
|
||||
return (dispatch, getState) => {
|
||||
const state = getState();
|
||||
const controlPipe = state.get('controlPipes').last();
|
||||
if (state.get('showingHelp')) {
|
||||
dispatch(hideHelp());
|
||||
} else if (state.get('searchQuery')) {
|
||||
dispatch(doSearch(''));
|
||||
} else if (state.get('searchFocused')) {
|
||||
dispatch(blurSearch());
|
||||
} else if (controlPipe && controlPipe.get('status') === 'PIPE_DELETED') {
|
||||
if (controlPipe && controlPipe.get('status') === 'PIPE_DELETED') {
|
||||
dispatch({
|
||||
type: ActionTypes.CLICK_CLOSE_TERMINAL,
|
||||
pipeId: controlPipe.get('id')
|
||||
});
|
||||
updateRoute(getState);
|
||||
// Don't deselect node on ESC if there is a controlPipe (keep terminal open)
|
||||
} else if (state.get('searchFocused')) {
|
||||
if (state.get('searchQuery')) {
|
||||
dispatch(doSearch(''));
|
||||
} else {
|
||||
dispatch(blurSearch());
|
||||
}
|
||||
} else if (state.get('showingHelp')) {
|
||||
dispatch(hideHelp());
|
||||
} else if (state.get('nodeDetails').last() && !controlPipe) {
|
||||
dispatch({ type: ActionTypes.DESELECT_NODE });
|
||||
updateRoute(getState);
|
||||
|
||||
Reference in New Issue
Block a user