Update error message when refreshing a feed from user interface
This commit is contained in:
parent
c0c77eeed3
commit
2a87847289
@ -117,6 +117,7 @@ Router\post_action('refresh-feed', function () {
|
|||||||
Response\json(array(
|
Response\json(array(
|
||||||
'feed_id' => $feed_id,
|
'feed_id' => $feed_id,
|
||||||
'result' => Handler\Feed\update_feed($user_id, $feed_id),
|
'result' => Handler\Feed\update_feed($user_id, $feed_id),
|
||||||
|
'feed' => Model\Feed\get_feed($user_id, $feed_id),
|
||||||
'items_count' => Model\ItemFeed\count_items_by_status($user_id, $feed_id),
|
'items_count' => Model\ItemFeed\count_items_by_status($user_id, $feed_id),
|
||||||
));
|
));
|
||||||
});
|
});
|
||||||
|
2
assets/js/app.min.js
vendored
2
assets/js/app.min.js
vendored
File diff suppressed because one or more lines are too long
@ -25,13 +25,20 @@ Miniflux.Feed = (function() {
|
|||||||
feed.removeAttribute("data-feed-error");
|
feed.removeAttribute("data-feed-error");
|
||||||
|
|
||||||
var lastChecked = feed.querySelector(".feed-last-checked");
|
var lastChecked = feed.querySelector(".feed-last-checked");
|
||||||
if (lastChecked) lastChecked.innerHTML = lastChecked.getAttribute("data-after-update");
|
if (lastChecked) {
|
||||||
|
lastChecked.innerHTML = lastChecked.getAttribute("data-after-update");
|
||||||
|
}
|
||||||
|
|
||||||
var response = JSON.parse(this.responseText);
|
var response = JSON.parse(this.responseText);
|
||||||
if (response.result) {
|
if (response.result) {
|
||||||
itemsCounter.innerHTML = response.items_count.items_unread + "/" + response.items_count.items_total;
|
itemsCounter.innerHTML = response.items_count.items_unread + "/" + response.items_count.items_total;
|
||||||
} else {
|
} else {
|
||||||
feed.setAttribute("data-feed-error", "1");
|
feed.setAttribute("data-feed-error", "1");
|
||||||
|
|
||||||
|
var errorMessageElement = feed.querySelector(".feed-parsing-error");
|
||||||
|
if (errorMessageElement) {
|
||||||
|
errorMessageElement.innerHTML = response.feed.parsing_error_message;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (callback) {
|
if (callback) {
|
||||||
|
Loading…
Reference in New Issue
Block a user