diff --git a/src/utils/history.utils.ts b/src/utils/history.utils.ts index fc813eb13..c2d0d8527 100644 --- a/src/utils/history.utils.ts +++ b/src/utils/history.utils.ts @@ -128,21 +128,22 @@ export function isFinalState(transaction: Pick): boolean } export function getReceiptUrl(transaction: TransactionDetails): string | undefined { + const hasReceiptPage = + transaction.extraDataForDrawer?.originalType && + [ + EHistoryEntryType.MANTECA_QR_PAYMENT, + EHistoryEntryType.MANTECA_OFFRAMP, + EHistoryEntryType.MANTECA_ONRAMP, + EHistoryEntryType.SEND_LINK, + ].includes(transaction.extraDataForDrawer.originalType) + if (hasReceiptPage) { + const typeId = historyTypeToNumber(transaction.extraDataForDrawer!.originalType) + return `${BASE_URL}/receipt/${transaction.id}?t=${typeId}` + } + if (transaction.extraDataForDrawer?.link) { return transaction.extraDataForDrawer.link } - if (!transaction.extraDataForDrawer?.originalType) { - return - } - const isManteca = [ - EHistoryEntryType.MANTECA_QR_PAYMENT, - EHistoryEntryType.MANTECA_OFFRAMP, - EHistoryEntryType.MANTECA_ONRAMP, - ].includes(transaction.extraDataForDrawer.originalType) - if (isManteca) { - const typeId = historyTypeToNumber(transaction.extraDataForDrawer.originalType) - return `${BASE_URL}/receipt/${transaction.id}?t=${typeId}` - } } export function getAvatarUrl(transaction: TransactionDetails): string | undefined {