Skip to content

Commit

Permalink
Shows "Connect integration" only if we selected creating from a branch.
Browse files Browse the repository at this point in the history
If user chooses to create a branch without an issue it doesn't require connection.
(#3621, #3698)
  • Loading branch information
chivorotkiv authored and sergeibbb committed Nov 12, 2024
1 parent 7596cfd commit f71bd9b
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions src/plus/startWork/startWork.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,27 +103,6 @@ export class StartWorkCommand extends QuickCommand<State> {
while (this.canStepsContinue(state)) {
context.title = this.title;

const hasConnectedIntegrations = [...context.connectedIntegrations.values()].some(c => c);
if (!hasConnectedIntegrations) {
if (this.container.telemetry.enabled) {
this.container.telemetry.sendEvent(
opened ? 'startWork/steps/connect' : 'startWork/opened',
{
...context.telemetryContext!,
connected: false,
},
this.source,
);
}
const isUsingCloudIntegrations = configuration.get('cloudIntegrations.enabled', undefined, false);
const result = isUsingCloudIntegrations
? yield* this.confirmCloudIntegrationsConnectStep(state, context)
: yield* this.confirmLocalIntegrationConnectStep(state, context);
if (result === StepResultBreak) {
return result;
}
}

if (state.counter < 1) {
const result = yield* this.selectCommandStep(state);
if (result === StepResultBreak) continue;
Expand All @@ -132,6 +111,27 @@ export class StartWorkCommand extends QuickCommand<State> {
}

if (state.counter < 2 && !state.action) {
const hasConnectedIntegrations = [...context.connectedIntegrations.values()].some(c => c);
if (!hasConnectedIntegrations) {
if (this.container.telemetry.enabled) {
this.container.telemetry.sendEvent(
opened ? 'startWork/steps/connect' : 'startWork/opened',
{
...context.telemetryContext!,
connected: false,
},
this.source,
);
}
const isUsingCloudIntegrations = configuration.get('cloudIntegrations.enabled', undefined, false);
const result = isUsingCloudIntegrations
? yield* this.confirmCloudIntegrationsConnectStep(state, context)
: yield* this.confirmLocalIntegrationConnectStep(state, context);
if (result === StepResultBreak) {
return result;
}
}

await updateContextItems(this.container, context);
const result = yield* this.pickIssueStep(state, context);
if (result === StepResultBreak) continue;
Expand Down

0 comments on commit f71bd9b

Please sign in to comment.