From 011c693aa04e8444204c800fa91676ef782e4e57 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Fri, 8 Aug 2025 17:20:13 -0400 Subject: [PATCH] Last details on running on the main thread --- app/src/main/java/com/greenart7c3/nostrsigner/Amber.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/greenart7c3/nostrsigner/Amber.kt b/app/src/main/java/com/greenart7c3/nostrsigner/Amber.kt index f4ef296c..1bde524d 100644 --- a/app/src/main/java/com/greenart7c3/nostrsigner/Amber.kt +++ b/app/src/main/java/com/greenart7c3/nostrsigner/Amber.kt @@ -195,14 +195,18 @@ class Amber : Application(), LifecycleObserver { super.onResume(owner) // activates the profile filter only when the app is in the foreground - profileSubscription.updateFilter() + applicationIOScope.launch { + profileSubscription.updateFilter() + } } override fun onPause(owner: LifecycleOwner) { super.onPause(owner) // closes the filter when in the background - profileSubscription.closeSub() + applicationIOScope.launch { + profileSubscription.closeSub() + } } })