diff --git a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/destination/model/SendDestinationModel.kt b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/destination/model/SendDestinationModel.kt index 14f2d7a777..510030607b 100644 --- a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/destination/model/SendDestinationModel.kt +++ b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/destination/model/SendDestinationModel.kt @@ -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() }