Skip to content

Commit fc4ff15

Browse files
committed
Reuses connected integrations by passing to getPullRequestIdentity...
(#3788, #3795)
1 parent ffe01f4 commit fc4ff15

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/plus/launchpad/launchpadProvider.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -214,14 +214,16 @@ export class LaunchpadProvider implements Disposable {
214214
}
215215

216216
private async getSearchedPullRequests(search: string, cancellation?: CancellationToken) {
217-
const prUrlIdentity: PullRequestUrlIdentity | undefined = await this.getPullRequestIdentityFromSearch(search);
217+
const connectedIntegrations = await this.getConnectedIntegrations();
218+
const prUrlIdentity: PullRequestUrlIdentity | undefined = await this.getPullRequestIdentityFromSearch(
219+
search,
220+
connectedIntegrations,
221+
);
218222
const result: { readonly value: SearchedPullRequest[]; duration: number } = {
219223
value: [],
220224
duration: 0,
221225
};
222226

223-
const connectedIntegrations = await this.getConnectedIntegrations();
224-
225227
const findByPrIdentity = async (
226228
integration: HostingIntegration,
227229
): Promise<undefined | TimedResult<SearchedPullRequest[] | undefined>> => {
@@ -589,8 +591,10 @@ export class LaunchpadProvider implements Disposable {
589591
);
590592
}
591593

592-
async getPullRequestIdentityFromSearch(search: string): Promise<PullRequestUrlIdentity | undefined> {
593-
const connectedIntegrations = await this.getConnectedIntegrations();
594+
async getPullRequestIdentityFromSearch(
595+
search: string,
596+
connectedIntegrations: Map<IntegrationId, boolean>,
597+
): Promise<PullRequestUrlIdentity | undefined> {
594598
for (const integrationId of supportedLaunchpadIntegrations) {
595599
if (connectedIntegrations.get(integrationId)) {
596600
const integration = await this.container.integrations.get(integrationId);

0 commit comments

Comments
 (0)