Updated on 2026-08-14

This commit is contained in:
Tangem 2025-03-18 13:46:21 +03:00
parent c9b3b3f555
commit bc93e1bce6

View file

@ -66,15 +66,6 @@ internal class AskBiometryModel @Inject constructor(
}
}
private fun onAllowClick() {
_uiState.update { it.copy(showProgress = true) }
allowToUseBiometrics()
}
private fun dontAllow() {
params.modelCallbacks.onDenied()
}
fun dismiss() {
modelScope.launch {
dismissBSFlow.emit(Unit)
@ -83,13 +74,15 @@ internal class AskBiometryModel @Inject constructor(
}
}
private fun allowToUseBiometrics() {
private fun onAllowClick() {
modelScope.launch {
if (tangemSdkManager.checkNeedEnrollBiometrics()) {
showEnrollBiometricsDialog()
return@launch
}
_uiState.update { it.copy(showProgress = true) }
/*
* because it will be automatically saved on UserWalletsListManager switch
@ -99,6 +92,7 @@ internal class AskBiometryModel @Inject constructor(
uiMessageSender.send(
SnackbarMessage(stringReference("No selected user wallet")),
)
_uiState.update { it.copy(showProgress = false) }
return@launch
}
@ -107,6 +101,10 @@ internal class AskBiometryModel @Inject constructor(
}
}
private fun dontAllow() {
params.modelCallbacks.onDenied()
}
private suspend fun handleSuccessAllowing(userWallet: UserWallet) {
walletsRepository.saveShouldSaveUserWallets(item = true)
settingsRepository.setShouldSaveAccessCodes(value = true)