Update error message when refreshing a feed from user interface
This commit is contained in:
parent
c0c77eeed3
commit
2a87847289
@ -115,8 +115,9 @@ Router\post_action('refresh-feed', function () {
|
||||
$feed_id = Request\int_param('feed_id', 0);
|
||||
|
||||
Response\json(array(
|
||||
'feed_id' => $feed_id,
|
||||
'result' => Handler\Feed\update_feed($user_id, $feed_id),
|
||||
'feed_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),
|
||||
));
|
||||
});
|
||||
|
@ -49,7 +49,7 @@
|
||||
<?php endif ?>
|
||||
|
||||
<span class="feed-parsing-error">
|
||||
<?php echo t('An error occurred during the last check: "%s".', $feed['parsing_error_message']) ?>
|
||||
<?php echo t('An error occurred during the last check: "%s".', $feed['parsing_error_message']) ?>
|
||||
</span>
|
||||
|
||||
<?php endif ?>
|
||||
|
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");
|
||||
|
||||
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);
|
||||
if (response.result) {
|
||||
itemsCounter.innerHTML = response.items_count.items_unread + "/" + response.items_count.items_total;
|
||||
} else {
|
||||
feed.setAttribute("data-feed-error", "1");
|
||||
|
||||
var errorMessageElement = feed.querySelector(".feed-parsing-error");
|
||||
if (errorMessageElement) {
|
||||
errorMessageElement.innerHTML = response.feed.parsing_error_message;
|
||||
}
|
||||
}
|
||||
|
||||
if (callback) {
|
||||
|
Loading…
Reference in New Issue
Block a user