diff options
Diffstat (limited to 'client/src/app/+my-account')
2 files changed, 10 insertions, 3 deletions
diff --git a/client/src/app/+my-account/my-account-notifications/my-account-notifications.component.html b/client/src/app/+my-account/my-account-notifications/my-account-notifications.component.html index d518b22ec..daf721f03 100644 --- a/client/src/app/+my-account/my-account-notifications/my-account-notifications.component.html +++ b/client/src/app/+my-account/my-account-notifications/my-account-notifications.component.html | |||
@@ -4,9 +4,12 @@ | |||
4 | Notification preferences | 4 | Notification preferences |
5 | </a> | 5 | </a> |
6 | 6 | ||
7 | <button (click)="markAllAsRead()" i18n> | 7 | <button class="btn" [disabled]="!getUnreadNotifications()" (click)="markAllAsRead()"> |
8 | <my-global-icon iconName="circle-tick"></my-global-icon> | 8 | <my-global-icon *ngIf="getUnreadNotifications()" iconName="inbox-full"></my-global-icon> |
9 | Mark all as read | 9 | <span i18n *ngIf="getUnreadNotifications()">Mark all as read</span> |
10 | |||
11 | <my-global-icon *ngIf="!getUnreadNotifications()" iconName="circle-tick"></my-global-icon> | ||
12 | <span i18n *ngIf="!getUnreadNotifications()">All read</span> | ||
10 | </button> | 13 | </button> |
11 | </div> | 14 | </div> |
12 | 15 | ||
diff --git a/client/src/app/+my-account/my-account-notifications/my-account-notifications.component.ts b/client/src/app/+my-account/my-account-notifications/my-account-notifications.component.ts index 9eca13d0f..156e7713d 100644 --- a/client/src/app/+my-account/my-account-notifications/my-account-notifications.component.ts +++ b/client/src/app/+my-account/my-account-notifications/my-account-notifications.component.ts | |||
@@ -11,4 +11,8 @@ export class MyAccountNotificationsComponent { | |||
11 | markAllAsRead () { | 11 | markAllAsRead () { |
12 | this.userNotification.markAllAsRead() | 12 | this.userNotification.markAllAsRead() |
13 | } | 13 | } |
14 | |||
15 | getUnreadNotifications () { | ||
16 | return this.userNotification.notifications.filter(n => n.read === false).length | ||
17 | } | ||
14 | } | 18 | } |