mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-17 23:44:39 -05: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
1 changed files with 4 additions and 2 deletions
|
@ -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…
Add table
Reference in a new issue