1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-11 17:51:01 +00:00

Improve page reload when showing unread/all entries

- Show only unread entries = refresh current page
- Show all entries = go to next page
This commit is contained in:
Diego Agulló 2019-04-05 03:59:04 +02:00 committed by fguillot
parent 8ee1a09dc7
commit a6068aae1d
6 changed files with 51 additions and 18 deletions

View file

@ -27,7 +27,7 @@ class NavHandler {
}
}
markPageAsRead() {
markPageAsRead(showOnlyUnread) {
let items = DomHelper.getVisibleElements(".items .item");
let entryIDs = [];
@ -39,7 +39,11 @@ class NavHandler {
if (entryIDs.length > 0) {
EntryHandler.updateEntriesStatus(entryIDs, "read", () => {
// This callback make sure the Ajax request reach the server before we reload the page.
this.goToPage("next", true);
if (showOnlyUnread) {
window.location.reload();
} else {
this.goToPage("next", true);
}
});
}
}