Updated on 2026-08-14
This commit is contained in:
parent
6638da98f1
commit
4574975639
11 changed files with 130 additions and 22 deletions
|
|
@ -14,7 +14,6 @@ import com.tangem.core.ui.components.bottomsheets.message.*
|
|||
import com.tangem.core.ui.extensions.TextReference
|
||||
import com.tangem.core.ui.extensions.resourceReference
|
||||
import com.tangem.core.ui.message.DialogMessage
|
||||
import com.tangem.core.ui.message.DialogMessage.Companion.invoke
|
||||
import com.tangem.core.ui.message.SnackbarMessage
|
||||
import com.tangem.core.ui.message.bottomSheetMessage
|
||||
import com.tangem.domain.card.SetCardWasScannedUseCase
|
||||
|
|
@ -125,6 +124,7 @@ internal class WalletWarningsClickIntentsImplementor @Inject constructor(
|
|||
private val getUserWalletUseCase: GetUserWalletUseCase,
|
||||
private val scanCardToUnlockWalletClickHandler: ScanCardToUnlockWalletClickHandler,
|
||||
private val unlockWalletsUseCase: UnlockWalletsUseCase,
|
||||
private val nonBiometricUnlockWalletUseCase: NonBiometricUnlockWalletUseCase,
|
||||
private val analyticsEventHandler: AnalyticsEventHandler,
|
||||
private val dispatchers: CoroutineDispatcherProvider,
|
||||
private val shouldShowPromoWalletUseCase: ShouldShowPromoWalletUseCase,
|
||||
|
|
@ -200,14 +200,8 @@ internal class WalletWarningsClickIntentsImplementor @Inject constructor(
|
|||
modelScope.launch {
|
||||
userWalletsListRepository.unlockAllWallets()
|
||||
.onLeft {
|
||||
val selectedUserWallet = getSelectedUserWallet() ?: return@onLeft
|
||||
val selectedUserWalletId = selectedUserWallet.walletId
|
||||
val method = when (selectedUserWallet) {
|
||||
is UserWallet.Cold -> UserWalletsListRepository.UnlockMethod.Scan()
|
||||
is UserWallet.Hot -> UserWalletsListRepository.UnlockMethod.AccessCode
|
||||
}
|
||||
userWalletsListRepository
|
||||
.unlock(stateHolder.getSelectedWalletId(), method)
|
||||
val selectedUserWalletId = stateHolder.getSelectedWalletId()
|
||||
nonBiometricUnlockWalletUseCase(selectedUserWalletId)
|
||||
.onLeft {
|
||||
when (it) {
|
||||
UnlockWalletError.AlreadyUnlocked -> Unit
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ internal class DefaultUserWalletsFetcher @AssistedInject constructor(
|
|||
@Assisted private val messageSender: UiMessageSender,
|
||||
@Assisted("onlyMultiCurrency") private val onlyMultiCurrency: Boolean,
|
||||
@Assisted("isAuthMode") private val isAuthMode: Boolean,
|
||||
@Assisted("isClickableIfLocked") private val isClickableIfLocked: Boolean,
|
||||
private val userWalletImageFetcher: UserWalletImageFetcher,
|
||||
dispatchers: CoroutineDispatcherProvider,
|
||||
) : UserWalletsFetcher {
|
||||
|
|
@ -60,6 +61,7 @@ internal class DefaultUserWalletsFetcher @AssistedInject constructor(
|
|||
val uiModels = UserWalletItemUMConverter(
|
||||
onClick = onWalletClick,
|
||||
isAuthMode = isAuthMode,
|
||||
isClickableIfLocked = isClickableIfLocked,
|
||||
).convertList(wallets)
|
||||
.toImmutableList()
|
||||
|
||||
|
|
@ -144,6 +146,7 @@ internal class DefaultUserWalletsFetcher @AssistedInject constructor(
|
|||
UserWalletItemUM.EndIcon.None
|
||||
},
|
||||
isAuthMode = isAuthMode,
|
||||
isClickableIfLocked = isClickableIfLocked,
|
||||
)
|
||||
.convert(userWallet)
|
||||
}
|
||||
|
|
@ -163,6 +166,7 @@ internal class DefaultUserWalletsFetcher @AssistedInject constructor(
|
|||
messageSender: UiMessageSender,
|
||||
@Assisted("onlyMultiCurrency") onlyMultiCurrency: Boolean,
|
||||
@Assisted("isAuthMode") isAuthMode: Boolean,
|
||||
@Assisted("isClickableIfLocked") isClickableIfLocked: Boolean,
|
||||
onWalletClick: (UserWalletId) -> Unit,
|
||||
): DefaultUserWalletsFetcher
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue