mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
fix: search only if selection changed (#868)
This commit is contained in:
parent
8c5ab86714
commit
0eb152c5db
1 changed files with 6 additions and 1 deletions
|
@ -264,6 +264,9 @@ class SearchFragment : Fragment() {
|
||||||
builder.setContentView(selectMainpageBinding.root)
|
builder.setContentView(selectMainpageBinding.root)
|
||||||
builder.show()
|
builder.show()
|
||||||
builder.let { dialog ->
|
builder.let { dialog ->
|
||||||
|
val previousSelectedApis = selectedApis.toSet()
|
||||||
|
val previousSelectedSearchTypes = selectedSearchTypes.toSet()
|
||||||
|
|
||||||
val isMultiLang = ctx.getApiProviderLangSettings().let { set ->
|
val isMultiLang = ctx.getApiProviderLangSettings().let { set ->
|
||||||
set.size > 1 || set.contains(AllLanguagesName)
|
set.size > 1 || set.contains(AllLanguagesName)
|
||||||
}
|
}
|
||||||
|
@ -352,7 +355,9 @@ class SearchFragment : Fragment() {
|
||||||
selectedApis = currentSelectedApis
|
selectedApis = currentSelectedApis
|
||||||
|
|
||||||
// run search when dialog is close
|
// 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())
|
updateList(selectedSearchTypes.toList())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue