Skip to content

Commit

Permalink
Fixes the flow to continue after user needed to connect an integration
Browse files Browse the repository at this point in the history
  • Loading branch information
chivorotkiv committed Nov 14, 2024
1 parent f060180 commit c9cf41a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/plus/startWork/startWork.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export class StartWorkCommand extends QuickCommand<State> {

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) {
Expand Down Expand Up @@ -159,6 +159,11 @@ export class StartWorkCommand extends QuickCommand<State> {
if (result === StepResultBreak) {
return result;
}
context.connectedIntegrations = await this.getConnectedIntegrations();
if (!this.hasConnectedIntegrations(context)) {
state.counter--;
continue;
}
}

await updateContextItems(this.container, context);
Expand Down Expand Up @@ -513,6 +518,10 @@ export class StartWorkCommand extends QuickCommand<State> {

return connected;
}

private hasConnectedIntegrations(context: Context) {
return [...context.connectedIntegrations.values()].some(c => c);
}
}

async function updateContextItems(container: Container, context: Context) {
Expand Down

0 comments on commit c9cf41a

Please sign in to comment.