diff options
Diffstat (limited to 'client/src/app/shared/users/user-notifications.component.ts')
-rw-r--r-- | client/src/app/shared/users/user-notifications.component.ts | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/client/src/app/shared/users/user-notifications.component.ts b/client/src/app/shared/users/user-notifications.component.ts index e3913ba56..b5f9fd399 100644 --- a/client/src/app/shared/users/user-notifications.component.ts +++ b/client/src/app/shared/users/user-notifications.component.ts | |||
@@ -20,11 +20,7 @@ export class UserNotificationsComponent implements OnInit { | |||
20 | // So we can access it in the template | 20 | // So we can access it in the template |
21 | UserNotificationType = UserNotificationType | 21 | UserNotificationType = UserNotificationType |
22 | 22 | ||
23 | componentPagination: ComponentPagination = { | 23 | componentPagination: ComponentPagination |
24 | currentPage: 1, | ||
25 | itemsPerPage: this.itemsPerPage, | ||
26 | totalItems: null | ||
27 | } | ||
28 | 24 | ||
29 | constructor ( | 25 | constructor ( |
30 | private userNotificationService: UserNotificationService, | 26 | private userNotificationService: UserNotificationService, |
@@ -32,6 +28,12 @@ export class UserNotificationsComponent implements OnInit { | |||
32 | ) { } | 28 | ) { } |
33 | 29 | ||
34 | ngOnInit () { | 30 | ngOnInit () { |
31 | this.componentPagination = { | ||
32 | currentPage: 1, | ||
33 | itemsPerPage: this.itemsPerPage, // Reset items per page, because of the @Input() variable | ||
34 | totalItems: null | ||
35 | } | ||
36 | |||
35 | this.loadMoreNotifications() | 37 | this.loadMoreNotifications() |
36 | } | 38 | } |
37 | 39 | ||
@@ -58,6 +60,8 @@ export class UserNotificationsComponent implements OnInit { | |||
58 | } | 60 | } |
59 | 61 | ||
60 | markAsRead (notification: UserNotification) { | 62 | markAsRead (notification: UserNotification) { |
63 | if (notification.read) return | ||
64 | |||
61 | this.userNotificationService.markAsRead(notification) | 65 | this.userNotificationService.markAsRead(notification) |
62 | .subscribe( | 66 | .subscribe( |
63 | () => { | 67 | () => { |