mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-17 15:24:40 +01:00
Ensure to update ChatInputPart state before updating viewmodel (#299119)
This commit is contained in:
@@ -1924,10 +1924,13 @@ export class ChatWidget extends Disposable implements IChatWidget {
|
||||
|
||||
this._codeBlockModelCollection.clear();
|
||||
|
||||
this.viewModel = this.instantiationService.createInstance(ChatViewModel, model, this._codeBlockModelCollection, undefined);
|
||||
|
||||
// Set the input model on the inputPart before assigning this.viewModel. Assigning this.viewModel
|
||||
// fires onDidChangeViewModel, which ChatInputPart listens to and expects the input model to be initialized.
|
||||
// Pass input model reference to input part for state syncing
|
||||
this.inputPart.setInputModel(model.inputModel, model.getRequests().length === 0);
|
||||
|
||||
this.viewModel = this.instantiationService.createInstance(ChatViewModel, model, this._codeBlockModelCollection, undefined);
|
||||
|
||||
this.listWidget.setViewModel(this.viewModel);
|
||||
|
||||
if (this._lockedAgent) {
|
||||
|
||||
Reference in New Issue
Block a user