Disabling online search after leaving the Search screen

This commit is contained in:
Vitor Pamplona
2023-03-16 16:33:17 -04:00
parent 8768daa06f
commit 0633707ec6
2 changed files with 4 additions and 1 deletions
@@ -18,7 +18,7 @@ object NostrSearchEventOrUserDataSource : NostrDataSource("SingleEventFeed") {
private fun createAnythingWithIDFilter(): List<TypedFilter>? { private fun createAnythingWithIDFilter(): List<TypedFilter>? {
val mySearchString = searchString val mySearchString = searchString
if (mySearchString == null) { if (mySearchString.isNullOrBlank()) {
return null return null
} }
@@ -97,10 +97,13 @@ fun SearchScreen(
if (event == Lifecycle.Event.ON_RESUME) { if (event == Lifecycle.Event.ON_RESUME) {
println("Global Start") println("Global Start")
NostrGlobalDataSource.start() NostrGlobalDataSource.start()
NostrSearchEventOrUserDataSource.start()
feedViewModel.refresh() feedViewModel.refresh()
} }
if (event == Lifecycle.Event.ON_PAUSE) { if (event == Lifecycle.Event.ON_PAUSE) {
println("Global Stop") println("Global Stop")
NostrSearchEventOrUserDataSource.clear()
NostrSearchEventOrUserDataSource.stop()
NostrGlobalDataSource.stop() NostrGlobalDataSource.stop()
} }
} }