use fetch directly
This commit is contained in:
parent
caf0bd78cb
commit
789e597271
|
@ -86,12 +86,11 @@
|
||||||
Events.openURLandHide.call(this, event);
|
Events.openURLandHide.call(this, event);
|
||||||
},
|
},
|
||||||
async prefetchAuthorId() {
|
async prefetchAuthorId() {
|
||||||
return this._fetch || (this._fetch = new Promise(async resolve => {
|
return this._fetch || (
|
||||||
const url = `${URLS.usoArchiveRaw[0]}styles/${this._id}.json`;
|
this._fetch = fetch(`${URLS.usoArchiveRaw[0]}styles/${this._id}.json`)
|
||||||
const json = await (await fetch(url)).json();
|
.then(r => r.json())
|
||||||
this.href = makeUsoArchiveAuthorUrl(json.info.author.id);
|
.then(json => (this.href = makeUsoArchiveAuthorUrl(json.info.author.id)))
|
||||||
resolve();
|
);
|
||||||
}));
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user