Skip to content

Commit 30525cf

Browse files
authored
Merge pull request #524 from GetStream/fix-mention-delete
fix: Deleting and reentering the same char after @ doesn't update the…
2 parents 4bb53f2 + bd6fdce commit 30525cf

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

projects/stream-chat-angular/src/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import { UserResponse } from 'stream-chat';
2323
import { ChannelService } from '../../channel.service';
2424
import { TextareaInterface } from '../textarea.interface';
2525
import { ChatClientService } from '../../chat-client.service';
26-
import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
26+
import { debounceTime } from 'rxjs/operators';
2727
import { TransliterationService } from '../../transliteration.service';
2828
import { EmojiInputService } from '../emoji-input.service';
2929
import { CustomTemplatesService } from '../../custom-templates.service';
@@ -128,13 +128,11 @@ export class AutocompleteTextareaComponent
128128
private customTemplatesService: CustomTemplatesService,
129129
private themeService: ThemeService
130130
) {
131-
this.searchTerm$
132-
.pipe(debounceTime(300), distinctUntilChanged())
133-
.subscribe((searchTerm) => {
134-
if (searchTerm.startsWith(this.mentionTriggerChar)) {
135-
void this.updateMentionOptions(searchTerm);
136-
}
137-
});
131+
this.searchTerm$.pipe(debounceTime(300)).subscribe((searchTerm) => {
132+
if (searchTerm.startsWith(this.mentionTriggerChar)) {
133+
void this.updateMentionOptions(searchTerm);
134+
}
135+
});
138136
this.subscriptions.push(
139137
this.channelService.activeChannel$.subscribe((channel) => {
140138
const commands = channel?.getConfig()?.commands || [];

0 commit comments

Comments
 (0)