Skip to content

Commit 4bda9b5

Browse files
authored
Hide model list if empty (microsoft#257486)
1 parent cf44916 commit 4bda9b5

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/vs/workbench/contrib/chat/browser/actions/manageModelsActions.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,10 @@ export class ManageModelsAction extends Action2 {
8181
}));
8282

8383
store.add(quickPick.onDidTriggerItemButton(async (event) => {
84-
const managementCommand = (event.item as IVendorQuickPickItem).managementCommand;
84+
const selectedItem = event.item as IVendorQuickPickItem;
85+
const managementCommand = selectedItem.managementCommand;
8586
if (managementCommand) {
86-
commandService.executeCommand(managementCommand);
87+
commandService.executeCommand(managementCommand, selectedItem.vendor);
8788
}
8889
}));
8990

@@ -106,6 +107,11 @@ export class ManageModelsAction extends Action2 {
106107
picked: model.metadata.isUserSelectable
107108
}));
108109

110+
if (modelItems.length === 0) {
111+
store.dispose();
112+
return;
113+
}
114+
109115
const quickPick = quickInputService.createQuickPick<IModelQuickPickItem>();
110116
quickPick.items = modelItems;
111117
quickPick.title = 'Manage Language Models';

0 commit comments

Comments
 (0)