diff --git a/designsafe/static/scripts/ng-designsafe/controllers/notifications.js b/designsafe/static/scripts/ng-designsafe/controllers/notifications.js index 4c3c4a00c..3fac0bc8e 100644 --- a/designsafe/static/scripts/ng-designsafe/controllers/notifications.js +++ b/designsafe/static/scripts/ng-designsafe/controllers/notifications.js @@ -34,7 +34,7 @@ export function NotificationBadgeCtrl( }; $scope.list = function() { - NotificationService.list().then(function(resp) { + NotificationService.list({'eventTypes[]': ['interactive_session_ready', 'job']}).then(function(resp) { $scope.data.notifications = resp.notifs; if (angular.element('#notification-container').hasClass('open')) { $scope.data.unread = 0; @@ -62,10 +62,13 @@ export function NotificationBadgeCtrl( 'notificationsurl': '/notifications' }; - $scope.count = function() { - $http.get('/api/notifications/badge/').then( - function(resp) { - $scope.data.unread = resp.data.unread; + $scope.count = function () { + $http({ + url: '/api/notifications/badge/', + method: 'GET', + params: { 'eventTypes[]': ['interactive_session_ready', 'job'] }, + }).then(function (resp) { + $scope.data.unread = resp.data.unread; }); }; diff --git a/designsafe/static/scripts/ng-designsafe/providers/notifications-provider.js b/designsafe/static/scripts/ng-designsafe/providers/notifications-provider.js index 19ab899a0..00bb898e7 100644 --- a/designsafe/static/scripts/ng-designsafe/providers/notifications-provider.js +++ b/designsafe/static/scripts/ng-designsafe/providers/notifications-provider.js @@ -64,9 +64,11 @@ function NotificationService( * @param {Object} msg */ function processMessage(e, msg) { - processors.notifs.process(msg); $rootScope.$broadcast('notification', msg); const eventType = msg.event_type.toLowerCase(); + if (eventType === 'job' || eventType === 'interactive_session_ready') { + processors.notifs.process(msg); + } if (typeof processors[eventType] !== 'undefined' && typeof processors[eventType].process !== 'undefined' && @@ -119,7 +121,7 @@ function NotificationService( * @param {Object} msg */ function processToastr(e, msg) { - if (msg.event_type === 'job' || msg.event_type ==='WEB' || msg.event_type === 'interactive_session_ready') { + if (msg.event_type === 'job' || msg.event_type === 'interactive_session_ready') { return; } diff --git a/designsafe/static/scripts/notifications/app.js b/designsafe/static/scripts/notifications/app.js index 18e4c7115..3a2a40e8c 100644 --- a/designsafe/static/scripts/notifications/app.js +++ b/designsafe/static/scripts/notifications/app.js @@ -23,7 +23,7 @@ angular.module('designsafe').controller('NotificationListCtrl', ['$scope','$root $scope.list = function(page=0){ $scope.data.pagination = {'limit': 10} - var params = {'limit': $scope.data.pagination.limit, page: page} + var params = {'limit': $scope.data.pagination.limit, page: page, 'eventTypes[]': ['interactive_session_ready', 'job']} NotificationService.list(params).then(function(resp) { $scope.data.pagination.show = false;