The number of unread items relies on an internal counter that is updated based on the server-side value of the `markAllAsRead` action.
Not waiting for the action to complete will cause the UI to become out-of-sync. Notably the unread indicator of the mobile UI tab relies on the internal counter that is updated at a later stage.
See https://www.woltlab.com/community/thread/296509-mobiles-kontrollzentrum-icon-bleibt/
link.addEventListener("click", (event) => {
event.preventDefault();
- this.markAllAsRead();
+ void this.markAllAsRead();
});
} else {
link.href = button.link;
return link;
}
- private markAllAsRead(): void {
- void this.provider.markAllAsRead();
+ private async markAllAsRead(): Promise<void> {
+ await this.provider.markAllAsRead();
this.getContent()
.querySelectorAll(".userMenuItem")
link.href = "#";
link.addEventListener("click", (event) => {
event.preventDefault();
- this.markAllAsRead();
+ void this.markAllAsRead();
});
}
else {
}
return link;
}
- markAllAsRead() {
- void this.provider.markAllAsRead();
+ async markAllAsRead() {
+ await this.provider.markAllAsRead();
this.getContent()
.querySelectorAll(".userMenuItem")
.forEach((element) => {