From 979c4e77e3e107c8ecc2f672fca1453002eda7dc Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Sun, 20 Aug 2017 18:00:07 +0200 Subject: [PATCH] Fix view bug when terminal reconnects but user has moved on --- webadmin/src/views/debug.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/webadmin/src/views/debug.js b/webadmin/src/views/debug.js index 4311bfd9a..b432874fb 100644 --- a/webadmin/src/views/debug.js +++ b/webadmin/src/views/debug.js @@ -176,8 +176,10 @@ angular.module('Application').controller('DebugController', ['$scope', '$locatio $scope.terminal.attach($scope.terminalSocket); $scope.terminalSocket.onclose = function () { - // retry in one second - setTimeout($scope.showTerminal.bind(null, true), 1000); + // retry in one second only if terminal view is still selected + setTimeout(function () { + if ($scope.terminalVisible) $scope.showTerminal(true); + }, 1000); }; } catch (e) { console.error(e);