mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-21 20:47:03 -05:00
Fix ANR when opening from notification/widget (#8683)
This commit is contained in:
parent
8945ef8880
commit
c288e6b8fa
1 changed files with 5 additions and 4 deletions
|
@ -73,7 +73,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
|
||||
|
@ -325,11 +324,13 @@ class MainActivity : BaseActivity() {
|
|||
}
|
||||
|
||||
override fun onNewIntent(intent: Intent) {
|
||||
val handle = runBlocking { handleIntentAction(intent) }
|
||||
lifecycleScope.launch {
|
||||
val handle = handleIntentAction(intent)
|
||||
if (!handle) {
|
||||
super.onNewIntent(intent)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private suspend fun handleIntentAction(intent: Intent): Boolean {
|
||||
val notificationId = intent.getIntExtra("notificationId", -1)
|
||||
|
|
Loading…
Reference in a new issue