From c836fe576d85f655f639ff6f617e4171f7c1acd3 Mon Sep 17 00:00:00 2001 From: Marcus Noble Date: Wed, 18 Nov 2020 19:12:31 +0000 Subject: [PATCH] Fix unread count --- views/index.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/views/index.html b/views/index.html index e936732..33f8cda 100644 --- a/views/index.html +++ b/views/index.html @@ -186,6 +186,7 @@ window.location.hash = feed; }, loadItem(item) { + this.setBusy(true); if (this.selectedItem === item.ID) { this.selectedItem = undefined; } else { @@ -194,6 +195,7 @@ item.PendingRead = true; fetch(`/api/read/${item.ID}`, {method: "POST"}) } + this.setBusy(false); }, saveItem(item) { this.setBusy(true); @@ -338,7 +340,7 @@ this.setBusy(true); Promise.all([ fetch(`/api/feeds`).then(res => res.json()).then(feeds => this.feeds = feeds), - fetch(`/api/unread`).then(res => res.json()).then(items => this.items = items), + fetch(`/api/unread`).then(res => res.json()).then(items => this.items = items.map(item => {item.PendingRead = false; return item;})), fetch(`/api/saved`).then(res => res.json()).then(items => this.savedItems = items) ]) .then(() => {