Skip to content

Commit

Permalink
Merge pull request #819 from weaveworks/818-close-disconnected-pipe-w…
Browse files Browse the repository at this point in the history
…ith-esc

Allow dismissing a disconnected terminal w/ <esc>
  • Loading branch information
foot committed Jan 19, 2016
2 parents 58cb2b7 + 8a7cfdb commit 4c4748e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions client/app/scripts/actions/app-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,17 @@ export function enterNode(nodeId) {
}

export function hitEsc() {
const controlPipe = AppStore.getControlPipe();
if (controlPipe && controlPipe.status === 'PIPE_DELETED') {
AppDispatcher.dispatch({
type: ActionTypes.CLICK_CLOSE_TERMINAL,
pipeId: controlPipe.id
});
// Dont deselect node on ESC if there is a controlPipe (keep terminal open)
if (AppStore.getSelectedNodeId() && !AppStore.getControlPipe()) {
} else if (AppStore.getSelectedNodeId() && !controlPipe) {
AppDispatcher.dispatch({type: ActionTypes.DESELECT_NODE});
updateRoute();
}
updateRoute();
}

export function leaveEdge(edgeId) {
Expand Down

0 comments on commit 4c4748e

Please sign in to comment.