mirror of
https://github.com/anticensority/runet-censorship-bypass.git
synced 2024-11-11 03:56:33 +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 = `http://httpstat.us/418`;
|
||||
const [comments, etag] = await fetch(
|
||||
const [error, comments, etag] = await fetch(
|
||||
ghUrl,
|
||||
params
|
||||
).then(
|
||||
|
@ -90,13 +90,14 @@ export default function getApp(theState) {
|
|||
: res
|
||||
).then(
|
||||
(res) => Promise.all([
|
||||
null,
|
||||
res.status !== 304 ? res.json() : false,
|
||||
res.headers.get('ETag')
|
||||
]),
|
||||
(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;
|
||||
}
|
||||
|
||||
if (error) {
|
||||
return; // Let user see the error message and contemplate.
|
||||
}
|
||||
|
||||
const ifNews = (() => {
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user