Fix view bug when terminal reconnects but user has moved on

This commit is contained in:
Johannes Zellner
2017-08-20 18:00:07 +02:00
parent e318fb0c01
commit 979c4e77e3

View File

@@ -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);