diff --git a/app/src/main/java/com/algorand/android/usecase/AssetTransferAmountPreviewUseCase.kt b/app/src/main/java/com/algorand/android/usecase/AssetTransferAmountPreviewUseCase.kt index 6c281a88..f30ae6d8 100644 --- a/app/src/main/java/com/algorand/android/usecase/AssetTransferAmountPreviewUseCase.kt +++ b/app/src/main/java/com/algorand/android/usecase/AssetTransferAmountPreviewUseCase.kt @@ -54,9 +54,8 @@ class AssetTransferAmountPreviewUseCase @Inject constructor( assetTransaction: AssetTransaction ): TransactionData.Send? { val senderAccountDetail = accountDetailUseCase.getCachedAccountDetail(accountAddress)?.data ?: return null - val receiverAccountDetail = accountDetailUseCase.getCachedAccountDetail( - assetTransaction.receiverUser?.publicKey.orEmpty() - )?.data ?: return null + val receiverAccountInfo = accountDetailUseCase.getCachedAccountDetail(accountAddress)?.data?.accountInformation + return TransactionData.Send( senderAccountAddress = senderAccountDetail.account.address, senderAccountDetail = senderAccountDetail.account.detail, @@ -74,7 +73,7 @@ class AssetTransferAmountPreviewUseCase @Inject constructor( publicKey = assetTransaction.receiverUser?.publicKey.orEmpty(), accountIconDrawablePreview = createAccountIconDrawableUseCase.invoke(accountAddress) ), - isArc59Transaction = !receiverAccountDetail.accountInformation.hasAsset(selectedAsset.assetId) + isArc59Transaction = receiverAccountInfo?.hasAsset(selectedAsset.assetId)?.not() ?: false ) } diff --git a/app/src/main/java/com/algorand/android/usecase/SenderAccountSelectionPreviewUseCase.kt b/app/src/main/java/com/algorand/android/usecase/SenderAccountSelectionPreviewUseCase.kt index 539cfcc3..36edacde 100644 --- a/app/src/main/java/com/algorand/android/usecase/SenderAccountSelectionPreviewUseCase.kt +++ b/app/src/main/java/com/algorand/android/usecase/SenderAccountSelectionPreviewUseCase.kt @@ -44,7 +44,7 @@ class SenderAccountSelectionPreviewUseCase @Inject constructor( assetTransaction: AssetTransaction ): TransactionData.Send? { val senderAccountDetail = accountDetailUseCase.getCachedAccountDetail(accountAddress)?.data ?: return null - val receiverAccountDetail = accountDetailUseCase.getCachedAccountDetail(accountAddress)?.data ?: return null + val receiverAccountInfo = accountDetailUseCase.getCachedAccountDetail(accountAddress)?.data?.accountInformation return TransactionData.Send( senderAccountAddress = senderAccountDetail.account.address, senderAccountDetail = senderAccountDetail.account.detail, @@ -62,7 +62,7 @@ class SenderAccountSelectionPreviewUseCase @Inject constructor( publicKey = assetTransaction.receiverUser?.publicKey.orEmpty(), accountIconDrawablePreview = createAccountIconDrawableUseCase.invoke(accountAddress) ), - isArc59Transaction = !receiverAccountDetail.accountInformation.hasAsset(selectedAsset.assetId) + isArc59Transaction = receiverAccountInfo?.hasAsset(selectedAsset.assetId)?.not() ?: false ) }