TB-74: minor fixes.

This commit is contained in:
Igor Kulikov 2017-12-05 15:01:31 +02:00
parent a075d9591d
commit 06a18bd559
2 changed files with 11 additions and 4 deletions

View File

@ -77,6 +77,7 @@ function ExtensionTableController($scope, $filter, $document, $translate, types,
if (newVal) { if (newVal) {
if ($scope.subscriber) { if ($scope.subscriber) {
telemetryWebsocketService.unsubscribe($scope.subscriber); telemetryWebsocketService.unsubscribe($scope.subscriber);
$scope.subscriber = null;
} }
vm.subscribed = false; vm.subscribed = false;
@ -88,6 +89,13 @@ function ExtensionTableController($scope, $filter, $document, $translate, types,
} }
}); });
$scope.$on('$destroy', function() {
if ($scope.subscriber) {
telemetryWebsocketService.unsubscribe($scope.subscriber);
$scope.subscriber = null;
}
});
$scope.$watch("vm.query.search", function(newVal, prevVal) { $scope.$watch("vm.query.search", function(newVal, prevVal) {
if (!angular.equals(newVal, prevVal) && vm.query.search != null) { if (!angular.equals(newVal, prevVal) && vm.query.search != null) {
updateExtensions(); updateExtensions();
@ -325,9 +333,8 @@ function ExtensionTableController($scope, $filter, $document, $translate, types,
vm.subscribed = true; vm.subscribed = true;
} }
}; };
telemetryWebsocketService.subscribe($scope.subscriber);
} }
telemetryWebsocketService.subscribe($scope.subscriber);
} }
} }
function onSubscriptionData(data) { function onSubscriptionData(data) {

View File

@ -95,10 +95,10 @@
>extension.field-required</div> >extension.field-required</div>
<div translate <div translate
ng-message="min" ng-message="min"
>Port should be in a range from 1 to 65535</div> >extension.port-range</div>
<div translate <div translate
ng-message="max" ng-message="max"
>Port should be in a range from 1 to 65535</div> >extension.port-range</div>
</div> </div>
</md-input-container> </md-input-container>
</div> </div>