Avoids bug on creating the live set in the IO thread.
This commit is contained in:
@@ -109,6 +109,10 @@ class AccountStateViewModel() : ViewModel() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
viewModelScope.launch(Dispatchers.IO) {
|
viewModelScope.launch(Dispatchers.IO) {
|
||||||
|
withContext(Dispatchers.Main) {
|
||||||
|
// Prepares livedata objects on the main user.
|
||||||
|
account.userProfile().live()
|
||||||
|
}
|
||||||
serviceManager?.restartIfDifferentAccount(account)
|
serviceManager?.restartIfDifferentAccount(account)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user