mirror of
https://github.com/anticensority/runet-censorship-bypass.git
synced 2024-11-10 19:46:34 +03:00
Merge branch 'work-even-if-dns-fails' into development
This commit is contained in:
commit
8f00516d44
|
@ -275,7 +275,10 @@
|
|||
<br/> <a href="https://rebrand.ly/ac-pacs">Comparison of PAC-scripts (ru)</a>.
|
||||
\`,
|
||||
order: 0,
|
||||
pacUrls: ['https://antizapret.prostovpn.org/proxy.pac'],
|
||||
pacUrls: [
|
||||
'https://antizapret.prostovpn.org/proxy.pac',
|
||||
'https://rebrand.ly/ac-antizapret-pac',
|
||||
],
|
||||
},
|
||||
Антицензорити: {
|
||||
distinctKey: 'Anticensority',
|
||||
|
@ -469,25 +472,28 @@
|
|||
reject([err, ...warns]);
|
||||
return;
|
||||
}
|
||||
resolve(err, res, ...warns);
|
||||
resolve([err, res, ...warns]);
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
const ipsErrorPromise = !ifUnattended
|
||||
const ipsPromise = !ifUnattended
|
||||
? updateIpsAsync()
|
||||
: tryPromiseSeveralTimesAsync(updateIpsAsync, [20, 40, 60]);
|
||||
|
||||
Promise.all([pacSetPromise, ipsErrorPromise]).then(
|
||||
([[pacErr, pacRes, ...pacWarns], ipsErr]) => {
|
||||
Promise.all([pacSetPromise, ipsPromise]).then(
|
||||
([[pacErr, pacRes, ...pacWarns], [ipsErr, ipsRes, ...ipsWarns]]) => {
|
||||
|
||||
if (pacErr && ipsErr) {
|
||||
if (pacErr) {
|
||||
return cb(pacErr, pacRes);
|
||||
}
|
||||
const warns = pacWarns;
|
||||
if (ipsErr) {
|
||||
warns.push(ipsErr);
|
||||
}
|
||||
if (ipsWarns.length) {
|
||||
warns.push(...ipsWarns);
|
||||
}
|
||||
this.pushToStorageAsync(
|
||||
(pushErr) => cb(pacErr || pushErr, null, ...warns),
|
||||
);
|
||||
|
|
|
@ -87,7 +87,7 @@
|
|||
"message": "Error"
|
||||
},
|
||||
"Non_critical_error": {
|
||||
"message": "Non-critical error"
|
||||
"message": "Non-critical error. Don't worry: it works"
|
||||
},
|
||||
"Donate": {
|
||||
"message": "Donate"
|
||||
|
|
|
@ -87,7 +87,7 @@
|
|||
"message": "Ошибка"
|
||||
},
|
||||
"Non_critical_error": {
|
||||
"message": "Некритичная ошибка"
|
||||
"message": "Некритичная ошибка. Всё хорошо, продолжаем работу"
|
||||
},
|
||||
"Donate": {
|
||||
"message": "Поддержать"
|
||||
|
|
|
@ -266,7 +266,6 @@ export default function getApp(theState) {
|
|||
this.setStatusTo(beforeStatus);
|
||||
this.switchInputs('off');
|
||||
operation((err, res, ...warns) => {
|
||||
|
||||
warns = warns.filter( (w) => w );
|
||||
if (err || warns.length) {
|
||||
this.showErrors(err, ...warns);
|
||||
|
|
|
@ -231,12 +231,11 @@
|
|||
getIpsFor(hostStr, (err, ips, ...warns) => {
|
||||
|
||||
console.log('Got IPs + err?:', ips, err);
|
||||
if (!err) {
|
||||
resolveIps(ips);
|
||||
} else {
|
||||
if (err) {
|
||||
reject([err, null, ...warns]);
|
||||
return;
|
||||
}
|
||||
|
||||
resolveIps(ips);
|
||||
});
|
||||
|
||||
}).then(
|
||||
|
@ -273,29 +272,18 @@
|
|||
);
|
||||
Promise.all( promises ).then( (cbsRes) => {
|
||||
|
||||
const errors = cbsRes.map( ([err]) => err ).filter( (err) => err );
|
||||
let newError;
|
||||
const ifAllErrors = cbsRes.length === errors.length;
|
||||
if (errors.length) {
|
||||
if (ifAllErrors) {
|
||||
newError = errors.shift();
|
||||
} else {
|
||||
newError = errors;
|
||||
}
|
||||
newError = clarify(
|
||||
newError,
|
||||
let ipErrors = cbsRes.map( ([err]) => err ).filter( (err) => err );
|
||||
let warns = [];
|
||||
if (ipErrors.length) {
|
||||
warns = [clarify(
|
||||
ipErrors,
|
||||
'Не удалось получить один или несколько IP адресов для' +
|
||||
' прокси-серверов. Иконка для уведомления об обходе' +
|
||||
' блокировок может не отображаться.'
|
||||
);
|
||||
if (ifAllErrors) {
|
||||
return cb(newError);
|
||||
}
|
||||
}
|
||||
cb(null, null, newError);
|
||||
|
||||
)];
|
||||
} else {}
|
||||
cb(null, null, ...warns);
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
_replaceAllAsync(hostArr = mandatory(), cb) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user