Skip to content

Commit

Permalink
fix: search only if selection changed (recloudstream#868)
Browse files Browse the repository at this point in the history
  • Loading branch information
coxju authored Jan 11, 2024
1 parent 8c5ab86 commit 0eb152c
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,9 @@ class SearchFragment : Fragment() {
builder.setContentView(selectMainpageBinding.root)
builder.show()
builder.let { dialog ->
val previousSelectedApis = selectedApis.toSet()
val previousSelectedSearchTypes = selectedSearchTypes.toSet()

val isMultiLang = ctx.getApiProviderLangSettings().let { set ->
set.size > 1 || set.contains(AllLanguagesName)
}
Expand Down Expand Up @@ -352,7 +355,9 @@ class SearchFragment : Fragment() {
selectedApis = currentSelectedApis

// run search when dialog is close
search(binding?.mainSearch?.query?.toString())
if(previousSelectedApis != selectedApis.toSet() || previousSelectedSearchTypes != selectedSearchTypes.toSet()) {
search(binding?.mainSearch?.query?.toString())
}
}
updateList(selectedSearchTypes.toList())
}
Expand Down

0 comments on commit 0eb152c

Please sign in to comment.