Skip to content

Commit

Permalink
PERA-1334 :: fix coinbase asset transfer via qr issue (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
yasin-ce authored Jan 2, 2025
1 parent f6d56f6 commit 808bdfb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
)
}

Expand Down

0 comments on commit 808bdfb

Please sign in to comment.