mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 15:44:54 +00:00
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:
committed by
GitHub
parent
afacef0146
commit
e8c6226586
@@ -0,0 +1 @@
|
|||||||
|
Mention selector gets stuck when quickly deleting the prompt.
|
||||||
+1
-1
@@ -192,7 +192,7 @@ class MessageComposerPresenter @Inject constructor(
|
|||||||
// This will trigger a search immediately when `@` is typed
|
// This will trigger a search immediately when `@` is typed
|
||||||
val mentionStartTrigger = suggestionSearchTrigger.filter { it?.text.isNullOrEmpty() }
|
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
|
// 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)
|
merge(mentionStartTrigger, mentionCompletionTrigger)
|
||||||
.combine(room.membersStateFlow) { suggestion, roomMembersState ->
|
.combine(room.membersStateFlow) { suggestion, roomMembersState ->
|
||||||
memberSuggestions.clear()
|
memberSuggestions.clear()
|
||||||
|
|||||||
Reference in New Issue
Block a user