Confirm on mark as read

This commit is contained in:
Marcus Noble 2020-11-07 16:31:10 +00:00
parent 4763ea0ae4
commit 5dc17162d2

View File

@ -184,8 +184,9 @@
}); });
}, },
markAllRead() { markAllRead() {
this.setBusy(true);
let ids = this.shownItems.filter(item => !item.Read).map(item => item.ID); let ids = this.shownItems.filter(item => !item.Read).map(item => item.ID);
if (confirm(`Are you sure you want to mark ${ids.length} items as read?`)) {
this.setBusy(true);
fetch( fetch(
`/api/read`, `/api/read`,
{method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(ids)} {method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(ids)}
@ -199,6 +200,7 @@
console.error(err); console.error(err);
this.setBusy(false); this.setBusy(false);
}); });
}
}, },
addSite(url) { addSite(url) {
this.setBusy(true); this.setBusy(true);