Skip to content

Commit d299e47

Browse files
authored
fix: remove existing status before updating with a new one (#423)
1 parent 0041aa1 commit d299e47

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/components/chat-item/chat-item-card.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,8 @@ export class ChatItemCard {
447447
}
448448

449449
if (this.props.chatItem.header.status != null) {
450+
// Remove existing status before adding new one
451+
this.cardHeader?.querySelector('.mynah-chat-item-card-header-status')?.remove();
450452
this.cardHeader?.insertAdjacentElement(this.props.chatItem.header.status.position === 'left' ? 'afterbegin' : 'beforeend', DomBuilder.getInstance().build({
451453
type: 'span',
452454
classNames: [ 'mynah-chat-item-card-header-status', `status-${this.props.chatItem.header.status.status ?? 'default'}` ],

0 commit comments

Comments
 (0)