diff --git a/services/web/app/views/project/list/notifications.pug b/services/web/app/views/project/list/notifications.pug index 724b5c80cc..f6e5190cf3 100644 --- a/services/web/app/views/project/list/notifications.pug +++ b/services/web/app/views/project/list/notifications.pug @@ -97,10 +97,6 @@ include ../../_mixins/saml .notification-action a.btn.btn-sm.btn-info(href="{{samlInitPath}}?university_id={{notification.institutionId}}&auto=/project&email={{notification.email}}") | #{translate('link_account')} - .notification-close - button(ng-click="dismiss(notification)").close.pull-right - span(aria-hidden="true") × - span.sr-only #{translate("close")} .alert.alert-info( ng-switch-when="notification_institution_sso_linked" diff --git a/services/web/frontend/js/main/project-list/notifications-controller.js b/services/web/frontend/js/main/project-list/notifications-controller.js index bf9f3efd49..4ece25db13 100644 --- a/services/web/frontend/js/main/project-list/notifications-controller.js +++ b/services/web/frontend/js/main/project-list/notifications-controller.js @@ -8,7 +8,11 @@ define(['../../base'], function(App) { $scope.samlInitPath = ExposedSettings.samlInitPath - $scope.dismiss = notification => + $scope.dismiss = notification => { + if (!notification._id) { + notification.hide = true + return + } $http({ url: `/notifications/${notification._id}`, method: 'DELETE', @@ -16,6 +20,7 @@ define(['../../base'], function(App) { 'X-Csrf-Token': window.csrfToken } }).then(() => (notification.hide = true)) + } }) App.controller('DismissableNotificationsController', function(