Updated on 2026-08-14

This commit is contained in:
Tangem 2024-06-17 15:11:40 +05:00
parent f5b2046666
commit e8a2b10e6f
10 changed files with 170 additions and 19 deletions

View file

@ -174,8 +174,8 @@ internal class DefaultWalletRouter(
reduxNavController.navigate(action = NavigationAction.NavigateTo(AppScreen.ManageTokens))
}
override fun openScanFailedDialog() {
reduxStateHolder.dispatchDialogShow(StateDialog.ScanFailsDialog(StateDialog.ScanFailsSource.MAIN))
override fun openScanFailedDialog(onTryAgain: () -> Unit) {
reduxStateHolder.dispatchDialogShow(StateDialog.ScanFailsDialog(StateDialog.ScanFailsSource.MAIN, onTryAgain))
}
private companion object {

View file

@ -59,5 +59,5 @@ internal interface InnerWalletRouter : WalletRouter {
fun openManageTokensScreen()
/** Open scan failed dialog */
fun openScanFailedDialog()
fun openScanFailedDialog(onTryAgain: () -> Unit)
}

View file

@ -165,7 +165,10 @@ internal class WalletWarningsClickIntentsImplementor @Inject constructor(
override fun onScanToUnlockWalletClick() {
analyticsEventHandler.send(MainScreen.UnlockWithCardScan)
openScanCardDialog()
}
private fun openScanCardDialog() {
viewModelScope.launch(dispatchers.main) {
scanCardToUnlockWalletClickHandler(walletId = stateHolder.getSelectedWalletId())
.onLeft { error ->
@ -175,7 +178,7 @@ internal class WalletWarningsClickIntentsImplementor @Inject constructor(
event = WalletEvent.ShowAlert(WalletAlertState.WrongCardIsScanned),
)
}
ScanCardToUnlockWalletError.ManyScanFails -> router.openScanFailedDialog()
ScanCardToUnlockWalletError.ManyScanFails -> router.openScanFailedDialog(::openScanCardDialog)
}
}
}