diff --git a/app/src/actions/Connection.ts b/app/src/actions/Connection.ts index b3448c7..e3edc8a 100644 --- a/app/src/actions/Connection.ts +++ b/app/src/actions/Connection.ts @@ -73,7 +73,11 @@ export const connecting: (connectionId: string) => Action = (connectionId: strin export const disconnect = () => (dispatch: Dispatch, getState: () => AppState) => { const { connectionId, tree } = getState().connection - rendererEvents.emit(removeConnection, connectionId) + if (connectionId) { + rendererEvents.emit(removeConnection, connectionId) + rendererEvents.unsubscribeAll(makeConnectionStateEvent(connectionId)) + } + tree && tree.stopUpdating() dispatch(showTree(undefined))