mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-14 06:10:31 +05:30
fix back behavior
This commit is contained in:
parent
8629adba29
commit
2490cc50b4
@ -289,6 +289,13 @@ class MainActivity : BaseActivity() {
|
||||
}
|
||||
|
||||
override fun onQueryTextChange(newText: String?): Boolean {
|
||||
// prevent malicious navigation when the search view is getting collapsed
|
||||
if (navController.currentDestination?.id == R.id.searchResultFragment &&
|
||||
(newText == null || newText == "")
|
||||
) {
|
||||
return false
|
||||
}
|
||||
|
||||
if (navController.currentDestination?.id != R.id.searchFragment) {
|
||||
val bundle = Bundle()
|
||||
bundle.putString("query", newText)
|
||||
@ -296,6 +303,7 @@ class MainActivity : BaseActivity() {
|
||||
} else {
|
||||
searchViewModel.setQuery(newText)
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user