web: fix unread count, use white-space pre

This commit is contained in:
Jens Langhammer
2021-01-16 17:02:48 +01:00
parent d020599e09
commit 4baf9e4a22
2 changed files with 8 additions and 9 deletions

View File

@ -22,6 +22,9 @@ export class NotificationDrawer extends LitElement {
display: flex;
flex-direction: column;
}
.pf-c-notification-drawer__list-item-description {
white-space: pre;
}
`
);
}
@ -29,7 +32,7 @@ export class NotificationDrawer extends LitElement {
firstUpdated(): void {
Notification.list().then(r => {
this.notifications = r;
this.unread = r.results.filter((n) => n.seen).length;
this.unread = r.results.filter((n) => !n.seen).length;
});
}
@ -60,12 +63,8 @@ export class NotificationDrawer extends LitElement {
${item.event?.action}
</h2>
</div>
<div class="pf-c-notification-drawer__list-item-description">
${item.body}
</div>
<div class="pf-c-notification-drawer__list-item-timestamp">
${age}
</div>
<p class="pf-c-notification-drawer__list-item-description">${item.body}</p>
<small class="pf-c-notification-drawer__list-item-timestamp">${age}</small>
</li>`;
}