diff options
author | Chocobozzz <me@florianbigard.com> | 2019-01-16 16:05:40 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-01-17 10:38:18 +0100 |
commit | 457bb213b273a9b206cc5654eb085cede4e916ad (patch) | |
tree | 6b1a317872a4ca27b5d0dbe543452320b26aacff /client/src/app/shared/users/user-notifications.component.ts | |
parent | 848f499def54db2dd36437ef0dfb74dd5041c23b (diff) | |
download | PeerTube-457bb213b273a9b206cc5654eb085cede4e916ad.tar.gz PeerTube-457bb213b273a9b206cc5654eb085cede4e916ad.tar.zst PeerTube-457bb213b273a9b206cc5654eb085cede4e916ad.zip |
Refactor how we use icons
Inject them in an angular component so we can easily change their color
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 | () => { |