From bd6fdcec8b413c228dfd92f62bbcbb62a6054a04 Mon Sep 17 00:00:00 2001 From: Zita Szupera Date: Mon, 8 Jan 2024 13:59:37 +0100 Subject: [PATCH] fix: Deleting and reentering the same char after @ doesn't update the mention menu --- .../autocomplete-textarea.component.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/projects/stream-chat-angular/src/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.ts b/projects/stream-chat-angular/src/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.ts index 6b636b29..4ddd210e 100644 --- a/projects/stream-chat-angular/src/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.ts +++ b/projects/stream-chat-angular/src/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.ts @@ -23,7 +23,7 @@ import { UserResponse } from 'stream-chat'; import { ChannelService } from '../../channel.service'; import { TextareaInterface } from '../textarea.interface'; import { ChatClientService } from '../../chat-client.service'; -import { debounceTime, distinctUntilChanged } from 'rxjs/operators'; +import { debounceTime } from 'rxjs/operators'; import { TransliterationService } from '../../transliteration.service'; import { EmojiInputService } from '../emoji-input.service'; import { CustomTemplatesService } from '../../custom-templates.service'; @@ -128,13 +128,11 @@ export class AutocompleteTextareaComponent private customTemplatesService: CustomTemplatesService, private themeService: ThemeService ) { - this.searchTerm$ - .pipe(debounceTime(300), distinctUntilChanged()) - .subscribe((searchTerm) => { - if (searchTerm.startsWith(this.mentionTriggerChar)) { - void this.updateMentionOptions(searchTerm); - } - }); + this.searchTerm$.pipe(debounceTime(300)).subscribe((searchTerm) => { + if (searchTerm.startsWith(this.mentionTriggerChar)) { + void this.updateMentionOptions(searchTerm); + } + }); this.subscriptions.push( this.channelService.activeChannel$.subscribe((channel) => { const commands = channel?.getConfig()?.commands || [];