diff --git a/src/plus/startWork/startWork.ts b/src/plus/startWork/startWork.ts index f2c408bbed775..8292e914b6dc0 100644 --- a/src/plus/startWork/startWork.ts +++ b/src/plus/startWork/startWork.ts @@ -103,7 +103,7 @@ export class StartWorkCommand extends QuickCommand { let opened = false; while (this.canStepsContinue(state)) { - const hasConnectedIntegrations = [...context.connectedIntegrations.values()].some(c => c); + const hasConnectedIntegrations = this.hasConnectedIntegrations(context); context.title = this.title; if (state.counter < 1) { @@ -159,6 +159,11 @@ export class StartWorkCommand extends QuickCommand { if (result === StepResultBreak) { return result; } + context.connectedIntegrations = await this.getConnectedIntegrations(); + if (!this.hasConnectedIntegrations(context)) { + state.counter--; + continue; + } } await updateContextItems(this.container, context); @@ -513,6 +518,10 @@ export class StartWorkCommand extends QuickCommand { return connected; } + + private hasConnectedIntegrations(context: Context) { + return [...context.connectedIntegrations.values()].some(c => c); + } } async function updateContextItems(container: Container, context: Context) {