diff options
author | Chocobozzz <me@florianbigard.com> | 2020-01-06 15:59:17 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-01-06 15:59:17 +0100 |
commit | bc6f886347f676220847461600122cde86edc272 (patch) | |
tree | a922e2ffe5bb536432a726793f025a1ed7bb2722 /client/src/app/+my-account | |
parent | 93d54cc769d88ecb2d7ead3ca293dac52653c13f (diff) | |
download | PeerTube-bc6f886347f676220847461600122cde86edc272.tar.gz PeerTube-bc6f886347f676220847461600122cde86edc272.tar.zst PeerTube-bc6f886347f676220847461600122cde86edc272.zip |
Fix mark all as read notifications
Diffstat (limited to 'client/src/app/+my-account')
2 files changed, 13 insertions, 7 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 daf721f03..dec3b14cc 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,12 +4,18 @@ | |||
4 | Notification preferences | 4 | Notification preferences |
5 | </a> | 5 | </a> |
6 | 6 | ||
7 | <button class="btn" [disabled]="!getUnreadNotifications()" (click)="markAllAsRead()"> | 7 | <button class="btn" [disabled]="!hasUnreadNotifications()" (click)="markAllAsRead()"> |
8 | <my-global-icon *ngIf="getUnreadNotifications()" iconName="inbox-full"></my-global-icon> | 8 | <ng-container *ngIf="hasUnreadNotifications()"> |
9 | <span i18n *ngIf="getUnreadNotifications()">Mark all as read</span> | 9 | <my-global-icon iconName="inbox-full"></my-global-icon> |
10 | 10 | ||
11 | <my-global-icon *ngIf="!getUnreadNotifications()" iconName="circle-tick"></my-global-icon> | 11 | <span i18n>Mark all as read</span> |
12 | <span i18n *ngIf="!getUnreadNotifications()">All read</span> | 12 | </ng-container> |
13 | |||
14 | <ng-container *ngIf="!hasUnreadNotifications()"> | ||
15 | <my-global-icon iconName="circle-tick"></my-global-icon> | ||
16 | |||
17 | <span i18n>All read</span> | ||
18 | </ng-container> | ||
13 | </button> | 19 | </button> |
14 | </div> | 20 | </div> |
15 | 21 | ||
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 156e7713d..a50cb0fb9 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 | |||
@@ -12,7 +12,7 @@ export class MyAccountNotificationsComponent { | |||
12 | this.userNotification.markAllAsRead() | 12 | this.userNotification.markAllAsRead() |
13 | } | 13 | } |
14 | 14 | ||
15 | getUnreadNotifications () { | 15 | hasUnreadNotifications () { |
16 | return this.userNotification.notifications.filter(n => n.read === false).length | 16 | return this.userNotification.notifications.filter(n => n.read === false).length !== 0 |
17 | } | 17 | } |
18 | } | 18 | } |