diff options
| author | 2015-01-18 11:59:03 +0100 | |
|---|---|---|
| committer | 2015-01-18 11:59:03 +0100 | |
| commit | 14206aca160355507ae50e6337c798733e730c15 (patch) | |
| tree | e3c3e567e041280ec74502989c50dcaddf638184 | |
| parent | d91a92434f516a9e25bf0dca608a0221094d0489 (diff) | |
Improve behavior when mark as read / favorite fail
If the request fails:
- Open a notification to inform user
- Remove pending index from the pending_feeds list
Fix https://github.com/FreshRSS/FreshRSS/issues/751
| -rw-r--r-- | app/i18n/en/gen.php | 3 | ||||
| -rw-r--r-- | app/i18n/fr/gen.php | 3 | ||||
| -rw-r--r-- | app/views/helpers/javascript_vars.phtml | 1 | ||||
| -rw-r--r-- | p/scripts/main.js | 6 |
4 files changed, 13 insertions, 0 deletions
diff --git a/app/i18n/en/gen.php b/app/i18n/en/gen.php index 6271717d4..539feaf40 100644 --- a/app/i18n/en/gen.php +++ b/app/i18n/en/gen.php @@ -95,6 +95,9 @@ return array( 'category_empty' => 'Empty category', 'confirm_action' => 'Are you sure you want to perform this action? It cannot be cancelled!', 'confirm_action_feed_cat' => 'Are you sure you want to perform this action? You will lose related favorites and user queries. It cannot be cancelled!', + 'feedback' => array( + 'request_failed' => 'A problem happened and the request failed.' + ), 'new_article' => 'There are new available articles, click to refresh the page.', 'notif_body_new_articles' => 'There are \\d new articles to read on FreshRSS.', 'notif_title_new_articles' => 'FreshRSS: new articles!', diff --git a/app/i18n/fr/gen.php b/app/i18n/fr/gen.php index 6b449484f..05ff9c38d 100644 --- a/app/i18n/fr/gen.php +++ b/app/i18n/fr/gen.php @@ -95,6 +95,9 @@ return array( 'category_empty' => 'Catégorie vide', 'confirm_action' => 'Êtes-vous sûr(e) de vouloir continuer ? Cette action ne peut être annulée !', 'confirm_action_feed_cat' => 'Êtes-vous sûr(e) de vouloir continuer ? Vous perdrez les favoris et les filtres associés. Cette action ne peut être annulée !', + 'feedback' => array( + 'request_failed' => 'Un problème est survenu et la requête a échoué.' + ), 'new_article' => 'Il y a de nouveaux articles disponibles, cliquez pour rafraîchir la page.', 'notif_body_new_articles' => 'Il y a \\d nouveaux articles à lire sur FreshRSS.', 'notif_title_new_articles' => 'FreshRSS : nouveaux articles !', diff --git a/app/views/helpers/javascript_vars.phtml b/app/views/helpers/javascript_vars.phtml index fec3a6f7c..1fef13b52 100644 --- a/app/views/helpers/javascript_vars.phtml +++ b/app/views/helpers/javascript_vars.phtml @@ -62,6 +62,7 @@ echo 'i18n={', 'confirmation_default:"', _t('gen.js.confirm_action'), '",', 'notif_title_articles:"', _t('gen.js.notif_title_new_articles'), '",', 'notif_body_articles:"', _t('gen.js.notif_body_new_articles'), '",', + 'notif_request_failed:"', _t('gen.js.feedback.request_failed'), '",', 'category_empty:"', _t('gen.js.category_empty'), '"', "},\n"; diff --git a/p/scripts/main.js b/p/scripts/main.js index 9b6524b01..0561097e5 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -155,6 +155,9 @@ function mark_read(active, only_not_read) { faviconNbUnread(); pending_feeds.splice(index_pending, 1); + }).fail(function (data) { + openNotification(i18n.notif_request_failed, 'bad'); + pending_feeds.splice(index_pending, 1); }); } @@ -210,6 +213,9 @@ function mark_favorite(active) { } pending_feeds.splice(index_pending, 1); + }).fail(function (data) { + openNotification(i18n.notif_request_failed, 'bad'); + pending_feeds.splice(index_pending, 1); }); } |
