From 254e7384cbd520089645d0ba187dcb0e29fbb6ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa?= Date: Mon, 26 Nov 2018 13:48:39 +0100 Subject: [PATCH] Improve notification click redirect --- app/modules/notifications/notifications.controller.coffee | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/modules/notifications/notifications.controller.coffee b/app/modules/notifications/notifications.controller.coffee index bcc63d66..69b9236a 100644 --- a/app/modules/notifications/notifications.controller.coffee +++ b/app/modules/notifications/notifications.controller.coffee @@ -42,7 +42,8 @@ class NotificationsController extends mixOf(taiga.Controller, taiga.PageMixin, t @.loadNotifications() @rootScope.$on "notifications:updated", (event) => - @.reloadList() + if @.onlyUnread + @.reloadList() initList: ()-> @.notificationsList = Immutable.List() @@ -73,15 +74,14 @@ class NotificationsController extends mixOf(taiga.Controller, taiga.PageMixin, t return @.notificationsList setAsRead: (notification, url) -> - @.loading = true - @scope.$emit("notifications:loading") @notificationsService.setNotificationAsRead(notification.get("id")).then => if @location.$$url == url @window.location.reload() else - @rootScope.$broadcast "notifications:updated" @location.path(url) + @rootScope.$broadcast "notifications:updated" + setAllAsRead: () -> @.loading = true @scope.$emit("notifications:loading")