mirror of
https://github.com/anticensority/runet-censorship-bypass.git
synced 2024-11-24 02:13:43 +03:00
Let user see news error
This commit is contained in:
parent
189687595e
commit
7344c018be
|
@ -81,7 +81,7 @@ export default function getApp(theState) {
|
||||||
|
|
||||||
//const ghUrl = `https://api.github.com/repos/anticensorship-russia/for-testing-github-api/issues/1/comments${query}`;
|
//const ghUrl = `https://api.github.com/repos/anticensorship-russia/for-testing-github-api/issues/1/comments${query}`;
|
||||||
const ghUrl = `http://httpstat.us/418`;
|
const ghUrl = `http://httpstat.us/418`;
|
||||||
const [comments, etag] = await fetch(
|
const [error, comments, etag] = await fetch(
|
||||||
ghUrl,
|
ghUrl,
|
||||||
params
|
params
|
||||||
).then(
|
).then(
|
||||||
|
@ -90,13 +90,14 @@ export default function getApp(theState) {
|
||||||
: res
|
: res
|
||||||
).then(
|
).then(
|
||||||
(res) => Promise.all([
|
(res) => Promise.all([
|
||||||
|
null,
|
||||||
res.status !== 304 ? res.json() : false,
|
res.status !== 304 ? res.json() : false,
|
||||||
res.headers.get('ETag')
|
res.headers.get('ETag')
|
||||||
]),
|
]),
|
||||||
(err) => {
|
(err) => {
|
||||||
|
|
||||||
this.showErrors({message: 'Не удалось достать новости: что-то не так с сетью.', wrapped: err});
|
this.showErrors({message: 'Не удалось достать новости: что-то не так с сетью.', wrapped: err});
|
||||||
return [false, false];
|
return [err, false, false];
|
||||||
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -104,6 +105,9 @@ export default function getApp(theState) {
|
||||||
localStorage[uiComEtag] = etag;
|
localStorage[uiComEtag] = etag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (error) {
|
||||||
|
return; // Let user see the error message and contemplate.
|
||||||
|
}
|
||||||
|
|
||||||
const ifNews = (() => {
|
const ifNews = (() => {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user