fix: show search history when clearing query

This commit is contained in:
Bnyro 2023-08-06 11:26:31 +02:00
parent f938a7dfc5
commit c253a4e415
2 changed files with 2 additions and 4 deletions

View File

@ -335,7 +335,7 @@ class MainActivity : BaseActivity() {
R.id.channelFragment,
R.id.playlistFragment
)
if (navController.currentDestination?.id in destIds && newText.isNullOrEmpty()) {
if (navController.currentDestination?.id in destIds && newText == null) {
return false
}

View File

@ -33,11 +33,9 @@ class SearchFragment : Fragment() {
private val binding get() = _binding!!
private val viewModel: SearchViewModel by activityViewModels()
private var query: String? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
query = arguments?.getString(IntentData.query)
viewModel.searchQuery.value = arguments?.getString(IntentData.query)
}
override fun onCreateView(