Do not attempt to reconnect if the debug view is already gone

Fixes #408
This commit is contained in:
Johannes Zellner
2017-08-28 21:06:22 +02:00
parent c47f878203
commit 56c7dbb6e4

View File

@@ -239,7 +239,9 @@ angular.module('Application').controller('DebugController', ['$scope', '$locatio
$scope.terminalSocket.onclose = function () {
// retry in one second only if terminal view is still selected
setTimeout(function () {
$scope.terminalReconnectTimeout = setTimeout(function () {
// if the scope was already destroyed, do not reconnect
if ($scope.$$destroyed) return;
if ($scope.terminalVisible) $scope.showTerminal(true);
}, 1000);
};