|
|
@@ -57,6 +57,7 @@ class ExploreFragment : VMBaseFragment<ExploreViewModel>(R.layout.fragment_explo
|
|
|
private var exploreFlowJob: Job? = null
|
|
|
private var groupsMenu: SubMenu? = null
|
|
|
private var isActive = false
|
|
|
+ private var searchKey: String? = null
|
|
|
|
|
|
override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) {
|
|
|
setSupportToolbar(binding.titleBar.toolbar)
|
|
|
@@ -123,6 +124,7 @@ class ExploreFragment : VMBaseFragment<ExploreViewModel>(R.layout.fragment_explo
|
|
|
}
|
|
|
|
|
|
private fun upExploreData(searchKey: String? = null, once: Boolean = false) {
|
|
|
+ this.searchKey = searchKey
|
|
|
exploreFlowJob?.cancel()
|
|
|
exploreFlowJob = launch {
|
|
|
when {
|
|
|
@@ -213,7 +215,7 @@ class ExploreFragment : VMBaseFragment<ExploreViewModel>(R.layout.fragment_explo
|
|
|
|
|
|
override fun onActive() {
|
|
|
isActive = true
|
|
|
- upExploreData()
|
|
|
+ upExploreData(searchKey)
|
|
|
}
|
|
|
|
|
|
override fun onInactive() {
|
|
|
@@ -223,7 +225,7 @@ class ExploreFragment : VMBaseFragment<ExploreViewModel>(R.layout.fragment_explo
|
|
|
|
|
|
override fun onResume() {
|
|
|
super.onResume()
|
|
|
- if (isActive) upExploreData()
|
|
|
+ if (isActive) upExploreData(searchKey)
|
|
|
}
|
|
|
|
|
|
}
|