Skip to content

Commit f71bd9b

Browse files
chivorotkivsergeibbb
authored andcommitted
Shows "Connect integration" only if we selected creating from a branch.
If user chooses to create a branch without an issue it doesn't require connection. (#3621, #3698)
1 parent 7596cfd commit f71bd9b

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

src/plus/startWork/startWork.ts

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -103,27 +103,6 @@ export class StartWorkCommand extends QuickCommand<State> {
103103
while (this.canStepsContinue(state)) {
104104
context.title = this.title;
105105

106-
const hasConnectedIntegrations = [...context.connectedIntegrations.values()].some(c => c);
107-
if (!hasConnectedIntegrations) {
108-
if (this.container.telemetry.enabled) {
109-
this.container.telemetry.sendEvent(
110-
opened ? 'startWork/steps/connect' : 'startWork/opened',
111-
{
112-
...context.telemetryContext!,
113-
connected: false,
114-
},
115-
this.source,
116-
);
117-
}
118-
const isUsingCloudIntegrations = configuration.get('cloudIntegrations.enabled', undefined, false);
119-
const result = isUsingCloudIntegrations
120-
? yield* this.confirmCloudIntegrationsConnectStep(state, context)
121-
: yield* this.confirmLocalIntegrationConnectStep(state, context);
122-
if (result === StepResultBreak) {
123-
return result;
124-
}
125-
}
126-
127106
if (state.counter < 1) {
128107
const result = yield* this.selectCommandStep(state);
129108
if (result === StepResultBreak) continue;
@@ -132,6 +111,27 @@ export class StartWorkCommand extends QuickCommand<State> {
132111
}
133112

134113
if (state.counter < 2 && !state.action) {
114+
const hasConnectedIntegrations = [...context.connectedIntegrations.values()].some(c => c);
115+
if (!hasConnectedIntegrations) {
116+
if (this.container.telemetry.enabled) {
117+
this.container.telemetry.sendEvent(
118+
opened ? 'startWork/steps/connect' : 'startWork/opened',
119+
{
120+
...context.telemetryContext!,
121+
connected: false,
122+
},
123+
this.source,
124+
);
125+
}
126+
const isUsingCloudIntegrations = configuration.get('cloudIntegrations.enabled', undefined, false);
127+
const result = isUsingCloudIntegrations
128+
? yield* this.confirmCloudIntegrationsConnectStep(state, context)
129+
: yield* this.confirmLocalIntegrationConnectStep(state, context);
130+
if (result === StepResultBreak) {
131+
return result;
132+
}
133+
}
134+
135135
await updateContextItems(this.container, context);
136136
const result = yield* this.pickIssueStep(state, context);
137137
if (result === StepResultBreak) continue;

0 commit comments

Comments
 (0)