Fix ANR when opening from notification/widget (#8683)

(cherry picked from commit c288e6b8face1f02e18a1a1a4f2dde4d48a2e576)
This commit is contained in:
Ivan Iskandar 2022-12-05 21:00:30 +07:00 committed by Jobobby04
parent f14bb4c736
commit acb251cc96

View File

@ -75,7 +75,6 @@ import kotlinx.coroutines.flow.drop
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
import logcat.LogPriority
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
@ -364,9 +363,11 @@ class MainActivity : BaseActivity() {
}
override fun onNewIntent(intent: Intent) {
val handle = runBlocking { handleIntentAction(intent) }
if (!handle) {
super.onNewIntent(intent)
lifecycleScope.launch {
val handle = handleIntentAction(intent)
if (!handle) {
super.onNewIntent(intent)
}
}
}