From 532b0b969f1c24c4100a3e1688e28461bf035879 Mon Sep 17 00:00:00 2001 From: "Ilya Ig. Petrov" Date: Thu, 8 Jun 2017 18:58:05 +0500 Subject: [PATCH] Don't show stale news if there are no news --- .../pages/options/src/components/App.js | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/App.js b/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/App.js index 2d4ee5b..2da3b4d 100644 --- a/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/App.js +++ b/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/App.js @@ -57,7 +57,6 @@ export default function getApp(theState) { const uiComDate = 'ui-last-comment-date'; const uiComEtag = 'ui-last-comments-etag'; - const uiLastNewsArr = 'ui-last-news-arr'; const statusFromHash = this.state.hashParams.get('status'); if (statusFromHash) { @@ -106,18 +105,13 @@ export default function getApp(theState) { } if (error) { - return; // Let user see the error message and contemplate. + return; // Let the user see the error message and contemplate. } const ifNews = (() => { if (!(comments && comments.length)) { - const json = localStorage[uiLastNewsArr]; - const news = json && JSON.parse(json); - if (news) { - this.setNewsStatusTo(news); - return true; - } + // Don't show stale news here. return false; } @@ -139,13 +133,12 @@ export default function getApp(theState) { return false; } localStorage[uiComDate] = minDate; - localStorage[uiLastNewsArr] = JSON.stringify(news); this.setNewsStatusTo(news); return true; })(); if (!ifNews) { - this.setStatusTo('Ничего нового.'); + this.setStatusTo('Хорошего настроения Вам!'); } }