changed apply in ws connections

parent 88830a9a
...@@ -59,8 +59,8 @@ dashboardControllers.controller('StudentCtrl', function StudentCtrl( ...@@ -59,8 +59,8 @@ dashboardControllers.controller('StudentCtrl', function StudentCtrl(
io.socket.on('disconnect', function () { io.socket.on('disconnect', function () {
$scope.studentData.pcb_count = 0; $scope.studentData.pcb_count = 0;
$scope.studentData.pdb_count = 0; $scope.studentData.pdb_count = 0;
$scope.$apply();
ngToast.warning($translate.instant('no_subscribed')); ngToast.warning($translate.instant('no_subscribed'));
$scope.$apply();
}); });
io.socket.on('reconnect', function () { io.socket.on('reconnect', function () {
...@@ -77,8 +77,8 @@ dashboardControllers.controller('StudentCtrl', function StudentCtrl( ...@@ -77,8 +77,8 @@ dashboardControllers.controller('StudentCtrl', function StudentCtrl(
if (data.room.search('student') != -1) { if (data.room.search('student') != -1) {
$scope.studentData.pcb_count = data.pcb_count; $scope.studentData.pcb_count = data.pcb_count;
$scope.studentData.pdb_count = data.pdb_count == 0 ? 1 : data.pdb_count; // because subscription is fastar than counter update $scope.studentData.pdb_count = data.pdb_count == 0 ? 1 : data.pdb_count; // because subscription is fastar than counter update
$scope.$apply();
ngToast.success($translate.instant('subscribed')); ngToast.success($translate.instant('subscribed'));
$scope.$apply();
} }
}); });
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment