Fix buggy update logic

This commit is contained in:
ilyaigpetrov 2023-05-05 18:39:21 +05:00
parent ae930da8b3
commit b3096c8d83

View File

@ -679,13 +679,14 @@
console.log('Updating from', oldAntiCensorRu.version, 'to', antiCensorRu.version);
try {
if (window.apis.version.isLeq(oldAntiCensorRu.version, '0.0.1.57')) {
const azWithPort = 'https://antizapret.prostovpn.org:8443/proxy.pac';
const azWithPortAlt = 'https://antizapret.prostovpn.org:18443/proxy.pac';
const urls = window.apis.antiCensorRu.pacProviders['Антизапрет'].pacUrls;
urls[0] = 'https://antizapret.prostovpn.org/proxy.pac';
urls.unshift(azWithPort, azWithPortAlt);
console.log('Successfully updated to 0.0.1.58.');
if (window.apis.version.isLeq(oldAntiCensorRu.version, '0.0.1.59')) {
window.apis.antiCensorRu.pacProviders['Антизапрет'].pacUrls = [
'https://antizapret.prostovpn.org:8443/proxy.pac',
'https://antizapret.prostovpn.org:18443/proxy.pac',
'https://antizapret.prostovpn.org/proxy.pac',
'https://rebrand.ly/ac-antizapret-pac',
];
console.log('Successfully updated to 0.0.1.60.');
}
} catch (e) {
// Log update error.