From 41a40bc3887c9e2331bbdd0d2729f2b97fcc2ed2 Mon Sep 17 00:00:00 2001 From: "Ilya Ig. Petrov" Date: Tue, 28 Feb 2017 08:10:34 +0000 Subject: [PATCH] Make provider forcing on update unnecessary --- .../37-sync-pac-script-with-pac-provider-api.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-common/37-sync-pac-script-with-pac-provider-api.js b/extensions/chromium/runet-censorship-bypass/src/extension-common/37-sync-pac-script-with-pac-provider-api.js index b635575..241ce2a 100644 --- a/extensions/chromium/runet-censorship-bypass/src/extension-common/37-sync-pac-script-with-pac-provider-api.js +++ b/extensions/chromium/runet-censorship-bypass/src/extension-common/37-sync-pac-script-with-pac-provider-api.js @@ -498,12 +498,14 @@ } else { // UPDATE & MIGRATION + console.log('Updating from ', oldStorage.version, 'to', antiCensorRu.version); const key = antiCensorRu._currentPacProviderKey; if (key !== null) { const ifVeryOld = !Object.keys(antiCensorRu.pacProviders).includes(key); - const ifWasForced = localStorage.getItem('provider-backup'); - if ( ifVeryOld || !ifWasForced ) { - if (!ifWasForced) { + const ifNeedsForcing = (oldStorage.version < '0.0.0.2') && !localStorage.getItem('provider-backup'); + if ( ifVeryOld || ifNeedsForcing ) { + if (ifNeedsForcing) { + console.log('Update forces antizapret...') localStorage.setItem('provider-backup', antiCensorRu._currentPacProviderKey); } antiCensorRu._currentPacProviderKey = 'Антизапрет';