chore: better handling of coroutine dispatchers.
All checks were successful
Check PR code / BuildAndTestAndCoverage (pull_request) Successful in 30m26s
All checks were successful
Check PR code / BuildAndTestAndCoverage (pull_request) Successful in 30m26s
This commit is contained in:
@ -334,7 +334,7 @@ class Repository(
|
||||
_badgeUnread.value -= 1
|
||||
}
|
||||
|
||||
CoroutineScope(Dispatchers.Main).launch {
|
||||
CoroutineScope(Dispatchers.Default).launch {
|
||||
updateDBItem(item)
|
||||
}
|
||||
}
|
||||
@ -345,7 +345,7 @@ class Repository(
|
||||
_badgeUnread.value += 1
|
||||
}
|
||||
|
||||
CoroutineScope(Dispatchers.Main).launch {
|
||||
CoroutineScope(Dispatchers.Default).launch {
|
||||
updateDBItem(item)
|
||||
}
|
||||
}
|
||||
@ -356,7 +356,7 @@ class Repository(
|
||||
_badgeStarred.value += 1
|
||||
}
|
||||
|
||||
CoroutineScope(Dispatchers.Main).launch {
|
||||
CoroutineScope(Dispatchers.Default).launch {
|
||||
updateDBItem(item)
|
||||
}
|
||||
}
|
||||
@ -367,7 +367,7 @@ class Repository(
|
||||
_badgeStarred.value -= 1
|
||||
}
|
||||
|
||||
CoroutineScope(Dispatchers.Main).launch {
|
||||
CoroutineScope(Dispatchers.Default).launch {
|
||||
updateDBItem(item)
|
||||
}
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ class SelfossApi(
|
||||
}
|
||||
modifyRequest {
|
||||
Napier.i("Will modify", tag = "HttpSend")
|
||||
CoroutineScope(Dispatchers.Main).launch {
|
||||
CoroutineScope(Dispatchers.IO).launch {
|
||||
Napier.i("Will login", tag = "HttpSend")
|
||||
login()
|
||||
Napier.i("Did login", tag = "HttpSend")
|
||||
|
@ -16,7 +16,7 @@ class ConnectivityService {
|
||||
fun start() {
|
||||
connectivity = Connectivity()
|
||||
connectivity.start()
|
||||
CoroutineScope(Dispatchers.Main).launch {
|
||||
CoroutineScope(Dispatchers.Default).launch {
|
||||
connectivity.statusUpdates.collect { status ->
|
||||
when (status) {
|
||||
is Connectivity.Status.Connected -> {
|
||||
|
Reference in New Issue
Block a user