fix ANR caused by direct message badge (#4182)
Saw an ANR (app not responding) error being reported in the Play console and then found this. Sorry but `runBlocking` in production code is an absolute no go.
This commit is contained in:
parent
d8c436c268
commit
9781e43441
2 changed files with 9 additions and 7 deletions
|
|
@ -66,7 +66,6 @@ import com.mikepenz.iconics.utils.sizeDp
|
|||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.flow.collectLatest
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import javax.inject.Inject
|
||||
import kotlin.time.DurationUnit
|
||||
import kotlin.time.toDuration
|
||||
|
|
@ -132,7 +131,7 @@ class ConversationsFragment :
|
|||
binding.progressBar.hide()
|
||||
|
||||
if (loadState.isAnyLoading()) {
|
||||
runBlocking {
|
||||
lifecycleScope.launch {
|
||||
eventHub.dispatch(ConversationsLoadingEvent(accountManager.activeAccount?.accountId ?: ""))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue