counter update in rooms fixed

parent e3be7077
...@@ -1447,7 +1447,6 @@ module.exports = { ...@@ -1447,7 +1447,6 @@ module.exports = {
sails.hooks.rooms.getUICount(room, (info) => { sails.hooks.rooms.getUICount(room, (info) => {
res.ok(info); res.ok(info);
}); });
}, },
// //
......
...@@ -74,10 +74,9 @@ dashboardControllers.controller('StudentCtrl', function StudentCtrl( ...@@ -74,10 +74,9 @@ dashboardControllers.controller('StudentCtrl', function StudentCtrl(
token: $window.sessionStorage.token token: $window.sessionStorage.token
}, },
function (data) { function (data) {
console.log(JSON.stringify(data));
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; $scope.studentData.pdb_count = data.pdb_count == 0 ? 1 : data.pdb_count; // because subscription is fastar than counter update
$scope.$apply(); $scope.$apply();
ngToast.success($translate.instant('subscribed')); ngToast.success($translate.instant('subscribed'));
} }
......
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