Skip to content

Commit f88e075

Browse files
committed
Fix promises process
1 parent 20908af commit f88e075

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/Services/GithubApiService.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,20 +56,16 @@ export class GithubApiService extends GithubRepository {
5656
}
5757
async requestUserInfo(username: string): Promise<UserInfo | ServiceError> {
5858
// Avoid to call others if one of them is null
59-
const repository = await this.requestUserRepository(username);
60-
61-
if (repository instanceof ServiceError) {
62-
Logger.error(repository);
63-
return repository;
64-
}
6559

6660
const promises = Promise.allSettled([
61+
this.requestUserRepository(username),
6762
this.requestUserActivity(username),
6863
this.requestUserIssue(username),
6964
this.requestUserPullRequest(username),
7065
]);
71-
const [activity, issue, pullRequest] = await promises;
66+
const [repository, activity, issue, pullRequest] = await promises;
7267
const status = [
68+
repository.status,
7369
activity.status,
7470
issue.status,
7571
pullRequest.status,
@@ -84,7 +80,7 @@ export class GithubApiService extends GithubRepository {
8480
(activity as PromiseFulfilledResult<GitHubUserActivity>).value,
8581
(issue as PromiseFulfilledResult<GitHubUserIssue>).value,
8682
(pullRequest as PromiseFulfilledResult<GitHubUserPullRequest>).value,
87-
repository,
83+
(repository as PromiseFulfilledResult<GitHubUserRepository>).value,
8884
);
8985
}
9086

0 commit comments

Comments
 (0)