Skip to content

Commit f24695a

Browse files
committed
fixup! In Start Work switches to issue list before waiting for the result
Moves telemetry (#3741, #3751)
1 parent 3b593ab commit f24695a

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/plus/startWork/startWork.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -161,21 +161,8 @@ export class StartWorkCommand extends QuickCommand<State> {
161161
}
162162
}
163163

164-
if (this.container.telemetry.enabled) {
165-
this.container.telemetry.sendEvent(
166-
opened ? 'startWork/steps/issue' : 'startWork/opened',
167-
{
168-
...context.telemetryContext!,
169-
connected: true,
170-
type: state.type,
171-
},
172-
this.source,
173-
);
174-
}
175-
164+
const result = yield* this.pickIssueStep(state, context, opened);
176165
opened = true;
177-
178-
const result = yield* this.pickIssueStep(state, context);
179166
if (result === StepResultBreak) continue;
180167
if (!isStartWorkTypeItem(result)) {
181168
state.item = result;
@@ -419,6 +406,7 @@ export class StartWorkCommand extends QuickCommand<State> {
419406
private *pickIssueStep(
420407
state: StepState<State>,
421408
context: Context,
409+
opened: boolean,
422410
): StepResultGenerator<StartWorkItem | StartWorkTypeItem> {
423411
const buildIssueItem = (i: StartWorkItem) => {
424412
const buttons = i.item.issue.url ? [OpenOnGitHubQuickInputButton] : [];
@@ -476,6 +464,18 @@ export class StartWorkCommand extends QuickCommand<State> {
476464
const { items, placeholder } = getItemsAndPlaceholder();
477465
quickpick.placeholder = placeholder;
478466
quickpick.items = items;
467+
468+
if (this.container.telemetry.enabled) {
469+
this.container.telemetry.sendEvent(
470+
opened ? 'startWork/steps/issue' : 'startWork/opened',
471+
{
472+
...context.telemetryContext!,
473+
connected: true,
474+
type: state.type,
475+
},
476+
this.source,
477+
);
478+
}
479479
} finally {
480480
quickpick.busy = false;
481481
}

0 commit comments

Comments
 (0)