Fixed a bug in AlbumBrowseActivity that was causing unnecessary

requeries against the backend.
This commit is contained in:
casey langen 2018-01-03 23:45:17 -08:00
parent 03e134aab9
commit 3705c278d3

View File

@ -79,15 +79,16 @@ class AlbumBrowseActivity : BaseActivity(), Filterable {
} }
override fun setFilter(filter: String) { override fun setFilter(filter: String) {
lastFilter = filter if (filter != lastFilter) {
filterDebouncer.call(filter) lastFilter = filter
filterDebouncer.call(filter)
}
} }
private fun initObservables() { private fun initObservables() {
disposables.add(data.provider.observeState().subscribeBy( disposables.add(data.provider.observeState().subscribeBy(
onNext = { state -> onNext = { state ->
if (state.first == IDataProvider.State.Connected) { if (state.first == IDataProvider.State.Connected) {
filterDebouncer.call()
requery() requery()
} }
else { else {