Updated on 2026-08-14

This commit is contained in:
Tangem 2025-04-15 19:22:32 +05:00
parent c6a3f70322
commit fac21a0c25

View file

@ -79,22 +79,11 @@ internal class SendDestinationModel @Inject constructor(
private var validationJobHolder = JobHolder()
init {
initSenderAddress()
configDestinationNavigation()
subscribeOnQRScannerResult()
initialState()
}
private fun initSenderAddress() {
modelScope.launch {
senderAddresses.value = getNetworkAddressesUseCase.invokeSync(userWalletId, cryptoCurrency.network)
.filter { cryptoCurrency.id == it.cryptoCurrency.id }
}
senderAddresses.onEach {
getWalletsAndRecent()
}.launchIn(modelScope)
}
private fun initialState() {
if ((uiState.value as? DestinationUM.Content)?.isInitialized == false) {
_uiState.update(
@ -112,6 +101,7 @@ internal class SendDestinationModel @Inject constructor(
),
)
}
initSenderAddress()
}
}
@ -150,6 +140,16 @@ internal class SendDestinationModel @Inject constructor(
)
}
private fun initSenderAddress() {
modelScope.launch {
senderAddresses.value = getNetworkAddressesUseCase.invokeSync(userWalletId, cryptoCurrency.network)
.filter { cryptoCurrency.id == it.cryptoCurrency.id }
}
senderAddresses.onEach {
getWalletsAndRecent()
}.launchIn(modelScope)
}
private fun subscribeOnQRScannerResult() {
listenToQrScanningUseCase(SourceType.SEND)
.getOrElse { emptyFlow() }