Fix mention selector getting stuck when quickly deleting the prompt (#2195)
* Fix mention selector getting stuck when quickly deleting the prompt
This commit is contained in:
parent
afacef0146
commit
e8c6226586
2 changed files with 2 additions and 1 deletions
1
changelog.d/2192.bugfix
Normal file
1
changelog.d/2192.bugfix
Normal file
|
|
@ -0,0 +1 @@
|
|||
Mention selector gets stuck when quickly deleting the prompt.
|
||||
|
|
@ -192,7 +192,7 @@ class MessageComposerPresenter @Inject constructor(
|
|||
// This will trigger a search immediately when `@` is typed
|
||||
val mentionStartTrigger = suggestionSearchTrigger.filter { it?.text.isNullOrEmpty() }
|
||||
// This will start a search when the user changes the text after the `@` with a debounce to prevent too much wasted work
|
||||
val mentionCompletionTrigger = suggestionSearchTrigger.filter { !it?.text.isNullOrEmpty() }.debounce(0.3.seconds)
|
||||
val mentionCompletionTrigger = suggestionSearchTrigger.debounce(0.3.seconds).filter { !it?.text.isNullOrEmpty() }
|
||||
merge(mentionStartTrigger, mentionCompletionTrigger)
|
||||
.combine(room.membersStateFlow) { suggestion, roomMembersState ->
|
||||
memberSuggestions.clear()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue