Skip to content

Commit 3b593ab

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

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

src/plus/startWork/startWork.ts

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

164-
await updateContextItems(this.container, context);
165164
if (this.container.telemetry.enabled) {
166165
this.container.telemetry.sendEvent(
167166
opened ? 'startWork/steps/issue' : 'startWork/opened',
@@ -470,14 +469,25 @@ export class StartWorkCommand extends QuickCommand<State> {
470469
};
471470
}
472471

473-
const { items, placeholder } = getItemsAndPlaceholder();
472+
const updateItems = async (quickpick: QuickPick<any>) => {
473+
quickpick.busy = true;
474+
try {
475+
await updateContextItems(this.container, context);
476+
const { items, placeholder } = getItemsAndPlaceholder();
477+
quickpick.placeholder = placeholder;
478+
quickpick.items = items;
479+
} finally {
480+
quickpick.busy = false;
481+
}
482+
};
474483

475-
const step = createPickStep<(typeof items)[0]>({
484+
const step = createPickStep<QuickPickItemOfT<StartWorkItem | StartWorkTypeItem>>({
476485
title: context.title,
477-
placeholder: placeholder,
486+
placeholder: 'Loading...',
478487
matchOnDescription: true,
479488
matchOnDetail: true,
480-
items: items,
489+
items: [],
490+
onDidActivate: updateItems,
481491
onDidClickItemButton: (_quickpick, button, { item }) => {
482492
if (button === OpenOnGitHubQuickInputButton && !isStartWorkTypeItem(item)) {
483493
this.open(item);

0 commit comments

Comments
 (0)