Updated on 2026-08-14
This commit is contained in:
parent
264a224d76
commit
fbbdddef8c
3 changed files with 98 additions and 0 deletions
|
|
@ -0,0 +1,33 @@
|
|||
package com.tangem.presentation.viewmodel
|
||||
|
||||
import android.arch.lifecycle.MutableLiveData
|
||||
import com.dmmatrix.epro.core.exception.Failure
|
||||
|
||||
class LoadedWalletViewModel : BaseViewModel() {
|
||||
|
||||
private val state: MutableLiveData<State> = MutableLiveData()
|
||||
|
||||
fun getState() = state
|
||||
|
||||
enum class State {
|
||||
ServerError,
|
||||
Failed,
|
||||
Success
|
||||
}
|
||||
|
||||
fun connectToken(data: String, data2: String) {
|
||||
|
||||
}
|
||||
|
||||
private fun handleTokensSaveFailure(failure: Failure) {
|
||||
state.value = State.Success
|
||||
handleFailure(failure)
|
||||
}
|
||||
|
||||
private fun handleLoginFailure(failure: Failure) {
|
||||
when (failure) {
|
||||
is Failure.ServerError -> state.value = State.ServerError
|
||||
}
|
||||
handleFailure(failure)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue