mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-29 15:12:58 +03:00
Updated site and member data to load in parallel
no refs Previously, the site and member data needed by Portal were loaded sequentially, which delayed the first load slightly as both the requests can be instead made in parallel. This change updates the API init to load both requests in parallel.
This commit is contained in:
parent
9472a29568
commit
8ac6364d3a
@ -244,8 +244,10 @@ function setupGhostApi({siteUrl = window.location.origin}) {
|
||||
};
|
||||
|
||||
api.init = async () => {
|
||||
const {site} = await api.site.read();
|
||||
const member = await api.member.sessionData();
|
||||
const [{site}, member] = await Promise.all([
|
||||
api.site.read(),
|
||||
api.member.sessionData()
|
||||
]);
|
||||
return {site, member};
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user