From 8a9ce3df9cae3f83886031afa8ab9770c42e8673 Mon Sep 17 00:00:00 2001 From: "Ilya Ig. Petrov" Date: Sat, 3 Jun 2017 20:22:57 +0500 Subject: [PATCH] Fix loss of err-to-exc collecting state, mend UI --- .../options/src/components/Exceptions.js | 4 ++-- .../src/extension-full/83-last-errors.js | 20 +++++++++++++++++-- .../pages/errors-to-exc/index.html | 2 +- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/Exceptions.js b/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/Exceptions.js index 21dc93c..ff695a7 100644 --- a/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/Exceptions.js +++ b/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/options/src/components/Exceptions.js @@ -71,10 +71,10 @@ export default function getExceptions(theState) { key: 'lookupLastErrors', desc: 'Собирать последние ошибки в запросах, чтобы вручную добавлять избранные из них в исключения.', }} - checked={props.bgWindow.apis.lastErrors.ifCollecting} + checked={props.bgWindow.apis.lastNetErrors.ifCollecting} onChange={(event) => { - props.bgWindow.apis.lastErrors.ifCollecting = event.target.checked; + props.bgWindow.apis.lastNetErrors.ifCollecting = event.target.checked; props.funs.setStatusTo('Сделано.'); }} diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-full/83-last-errors.js b/extensions/chromium/runet-censorship-bypass/src/extension-full/83-last-errors.js index 96c8a91..03e0a7d 100644 --- a/extensions/chromium/runet-censorship-bypass/src/extension-full/83-last-errors.js +++ b/extensions/chromium/runet-censorship-bypass/src/extension-full/83-last-errors.js @@ -6,8 +6,24 @@ const lastErrors = []; const lastErrorsLength = 20; - const that = window.apis.lastErrors = { - ifCollecting: false, + const IF_COLL_KEY = 'err-to-exc-if-coll'; + + const privates = { + ifCollecting: window.localStorage[IF_COLL_KEY] || false, + }; + + const that = window.apis.lastNetErrors = { + get ifCollecting() { + + return privates.ifCollecting; + + }, + + set ifCollecting(newValue) { + + privates.ifCollecting = window.localStorage[IF_COLL_KEY] = newValue; + + }, get: () => lastErrors, } diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-full/pages/errors-to-exc/index.html b/extensions/chromium/runet-censorship-bypass/src/extension-full/pages/errors-to-exc/index.html index 776f736..173de11 100644 --- a/extensions/chromium/runet-censorship-bypass/src/extension-full/pages/errors-to-exc/index.html +++ b/extensions/chromium/runet-censorship-bypass/src/extension-full/pages/errors-to-exc/index.html @@ -41,7 +41,7 @@

Список последних ошибок

- Новые сверху, количество ошибок ограничено 20тью. + Новые сверху, количество ошибок ограничено 20ю.