Fix characters erased from the Search field when the result are coming (#545)

This commit is contained in:
Benoit Marty 2019-09-17 14:55:19 +02:00 committed by Benoit Marty
parent 3739e50d46
commit b3d649a4d9
2 changed files with 9 additions and 4 deletions

View file

@ -11,7 +11,7 @@ Other changes:
-
Bugfix:
-
- Fix characters erased from the Search field when the result are coming (#545)
Translations:
-

View file

@ -143,10 +143,15 @@ class PublicRoomsFragment : VectorBaseFragment(), PublicRoomsController.Callback
viewModel.loadMore()
}
var initialValueSet = false
override fun invalidate() = withState(viewModel) { state ->
if (publicRoomsFilter.query.toString() != state.currentFilter) {
// For initial filter
publicRoomsFilter.setQuery(state.currentFilter, false)
if (!initialValueSet) {
initialValueSet = true
if (publicRoomsFilter.query.toString() != state.currentFilter) {
// For initial filter
publicRoomsFilter.setQuery(state.currentFilter, false)
}
}
// Populate list with Epoxy