fix crash on any error on friends screen other than api error

This commit is contained in:
2024-07-14 01:04:20 +03:00
parent 43fe1832f7
commit 9481541806
@@ -69,26 +69,15 @@ class FriendsViewModelImpl(
friendsUseCase.getAllFriends(count = LOAD_COUNT, offset = offset).listenValue { state ->
state.processState(
error = { error ->
when (error) {
is State.Error.ApiError -> {
val (code, message) = error
when (code) {
if (error is State.Error.ApiError) {
when (error.errorCode) {
VkErrorCodes.UserAuthorizationFailed -> {
baseError.setValue { BaseError.SessionExpired }
}
else -> {
Unit
else -> Unit
}
}
}
State.Error.ConnectionError -> TODO()
State.Error.InternalError -> TODO()
is State.Error.OAuthError -> TODO()
State.Error.Unknown -> TODO()
}
},
success = { info ->
val response = info.friends