Skip to content

Commit

Permalink
Rename updateAttachments() to clearAttachments()
Browse files Browse the repository at this point in the history
  • Loading branch information
brichet committed Feb 6, 2025
1 parent a96b7e5 commit 2658548
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions packages/jupyter-chat/src/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,9 @@ export interface IChatModel extends IDisposable {
removeAttachment?(attachment: IAttachment): void;

/**
* Update attachments.
* Clear the attachment list.
*/
updateAttachments?(attachments: IAttachment[]): void;
clearAttachments?(): void;

/**
* Open attachments.
Expand Down Expand Up @@ -586,9 +586,9 @@ export class ChatModel implements IChatModel {
/**
* Update attachments.
*/
updateAttachments = (attachments: IAttachment[]): void => {
this.inputAttachments = [...attachments];
this._inputAttachmentsChanges.emit([...this.inputAttachments]);
clearAttachments = (): void => {
this.inputAttachments = [];
this._inputAttachmentsChanges.emit([]);
};

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/jupyterlab-chat/src/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export class LabChatModel extends ChatModel implements DocumentRegistry.IModel {
this.sharedModel.setAttachment(attachment)
);
msg.attachments = attachmentIds;
this.updateAttachments([]);
this.clearAttachments();
}

this.sharedModel.addMessage(msg);
Expand Down

0 comments on commit 2658548

Please sign in to comment.