remove usage of context-receivers

This commit is contained in:
2024-08-14 12:04:04 +03:00
parent 0500969d81
commit ee8cf619f8
11 changed files with 98 additions and 112 deletions
@@ -1,6 +1,7 @@
package dev.meloda.fast.profile
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import dev.meloda.fast.common.VkConstants
import dev.meloda.fast.common.extensions.listenValue
import dev.meloda.fast.common.extensions.setValue
@@ -32,7 +33,7 @@ class ProfileViewModelImpl(
private fun getLocalAccountInfo() {
usersUseCase.getLocalUser(UserConfig.userId)
.listenValue { state ->
.listenValue(viewModelScope) { state ->
state.processState(
error = { error ->
if (error is State.Error.ApiError) {
@@ -70,7 +71,7 @@ class ProfileViewModelImpl(
userIds = null,
fields = VkConstants.USER_FIELDS,
nomCase = null
).listenValue { state ->
).listenValue(viewModelScope) { state ->
state.processState(
error = { error ->
// TODO: 12/07/2024, Danil Nikolaev: if local info is null then show error view