diff --git a/src/providers/tfc/uiHelpers.ts b/src/providers/tfc/uiHelpers.ts index 904aa56647..3c39ad8605 100644 --- a/src/providers/tfc/uiHelpers.ts +++ b/src/providers/tfc/uiHelpers.ts @@ -50,16 +50,23 @@ export class APIQuickPick { async pick(autoHide = true) { await this.fetchResource(); - const result = await new Promise((c) => { + const result = await new Promise((resolve) => { this.quickPick.onDidAccept(() => { - c(this.quickPick.selectedItems[0]); + const selection = this.quickPick.selectedItems[0]; + resolve(selection); + // this.quickPick.hide(); }); + this.quickPick.onDidHide(() => { - c(undefined); + resolve(undefined); + // this.quickPick.dispose(); }); - this.quickPick.show(); + + // this.quickPick.show(); }); + // this.quickPick.show(); + if (autoHide) { this.quickPick.hide(); } @@ -70,6 +77,10 @@ export class APIQuickPick { hide() { this.quickPick.hide(); } + + dispose() { + this.quickPick.dispose(); + } } export async function handleZodiosError(