[WEB-1467] chore: run the API's required to bootstrap the application in parallel. (#4642)

This commit is contained in:
Prateek Shourya 2024-05-30 16:20:58 +05:30 committed by GitHub
parent 67bd14ceb5
commit b016e1d1b5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 3 deletions

View File

@ -97,9 +97,11 @@ export class UserStore implements IUserStore {
});
const user = await this.userService.currentUser();
if (user && user?.id) {
await this.userProfile.fetchUserProfile();
await this.userSettings.fetchCurrentUserSettings();
await this.store.workspaceRoot.fetchWorkspaces();
await Promise.all([
this.userProfile.fetchUserProfile(),
this.userSettings.fetchCurrentUserSettings(),
this.store.workspaceRoot.fetchWorkspaces(),
]);
runInAction(() => {
this.data = user;
this.isLoading = false;

View File

@ -104,6 +104,7 @@ export class ProfileStore implements IUserProfileStore {
message: "Failed to fetch user profile",
};
});
throw error;
}
};

View File

@ -73,6 +73,7 @@ export class UserSettingsStore implements IUserSettingsStore {
message: "Failed to fetch user settings",
};
});
throw error;
}
};
}