fix crash on any error on friends screen other than api error
This commit is contained in:
@@ -69,25 +69,14 @@ class FriendsViewModelImpl(
|
|||||||
friendsUseCase.getAllFriends(count = LOAD_COUNT, offset = offset).listenValue { state ->
|
friendsUseCase.getAllFriends(count = LOAD_COUNT, offset = offset).listenValue { state ->
|
||||||
state.processState(
|
state.processState(
|
||||||
error = { error ->
|
error = { error ->
|
||||||
when (error) {
|
if (error is State.Error.ApiError) {
|
||||||
is State.Error.ApiError -> {
|
when (error.errorCode) {
|
||||||
val (code, message) = error
|
VkErrorCodes.UserAuthorizationFailed -> {
|
||||||
|
baseError.setValue { BaseError.SessionExpired }
|
||||||
when (code) {
|
|
||||||
VkErrorCodes.UserAuthorizationFailed -> {
|
|
||||||
baseError.setValue { BaseError.SessionExpired }
|
|
||||||
}
|
|
||||||
|
|
||||||
else -> {
|
|
||||||
Unit
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
State.Error.ConnectionError -> TODO()
|
else -> Unit
|
||||||
State.Error.InternalError -> TODO()
|
}
|
||||||
is State.Error.OAuthError -> TODO()
|
|
||||||
State.Error.Unknown -> TODO()
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
success = { info ->
|
success = { info ->
|
||||||
|
|||||||
Reference in New Issue
Block a user