Commit 06a18bd559a3f0e4ace5ad3611b51e0f6729c67f

Authored by Igor Kulikov
1 parent a075d959

TB-74: minor fixes.

@@ -77,6 +77,7 @@ function ExtensionTableController($scope, $filter, $document, $translate, types, @@ -77,6 +77,7 @@ function ExtensionTableController($scope, $filter, $document, $translate, types,
77 if (newVal) { 77 if (newVal) {
78 if ($scope.subscriber) { 78 if ($scope.subscriber) {
79 telemetryWebsocketService.unsubscribe($scope.subscriber); 79 telemetryWebsocketService.unsubscribe($scope.subscriber);
  80 + $scope.subscriber = null;
80 } 81 }
81 82
82 vm.subscribed = false; 83 vm.subscribed = false;
@@ -88,6 +89,13 @@ function ExtensionTableController($scope, $filter, $document, $translate, types, @@ -88,6 +89,13 @@ function ExtensionTableController($scope, $filter, $document, $translate, types,
88 } 89 }
89 }); 90 });
90 91
  92 + $scope.$on('$destroy', function() {
  93 + if ($scope.subscriber) {
  94 + telemetryWebsocketService.unsubscribe($scope.subscriber);
  95 + $scope.subscriber = null;
  96 + }
  97 + });
  98 +
91 $scope.$watch("vm.query.search", function(newVal, prevVal) { 99 $scope.$watch("vm.query.search", function(newVal, prevVal) {
92 if (!angular.equals(newVal, prevVal) && vm.query.search != null) { 100 if (!angular.equals(newVal, prevVal) && vm.query.search != null) {
93 updateExtensions(); 101 updateExtensions();
@@ -325,9 +333,8 @@ function ExtensionTableController($scope, $filter, $document, $translate, types, @@ -325,9 +333,8 @@ function ExtensionTableController($scope, $filter, $document, $translate, types,
325 vm.subscribed = true; 333 vm.subscribed = true;
326 } 334 }
327 }; 335 };
  336 + telemetryWebsocketService.subscribe($scope.subscriber);
328 } 337 }
329 - telemetryWebsocketService.subscribe($scope.subscriber);  
330 -  
331 } 338 }
332 } 339 }
333 function onSubscriptionData(data) { 340 function onSubscriptionData(data) {
@@ -95,10 +95,10 @@ @@ -95,10 +95,10 @@
95 >extension.field-required</div> 95 >extension.field-required</div>
96 <div translate 96 <div translate
97 ng-message="min" 97 ng-message="min"
98 - >Port should be in a range from 1 to 65535</div> 98 + >extension.port-range</div>
99 <div translate 99 <div translate
100 ng-message="max" 100 ng-message="max"
101 - >Port should be in a range from 1 to 65535</div> 101 + >extension.port-range</div>
102 </div> 102 </div>
103 </md-input-container> 103 </md-input-container>
104 </div> 104 </div>