1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 11:22:43 +02:00

Throw error if transaction type is not recognized by useTransactionDisplay data (#11104)

This commit is contained in:
Dan J Miller 2021-05-14 18:33:14 -02:30 committed by GitHub
parent fc256157f6
commit 4689546eb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -220,6 +220,10 @@ export function useTransactionDisplayData(transactionGroup) {
category = TRANSACTION_GROUP_CATEGORIES.SEND; category = TRANSACTION_GROUP_CATEGORIES.SEND;
title = t('send'); title = t('send');
subtitle = t('toAddress', [shortenAddress(recipientAddress)]); subtitle = t('toAddress', [shortenAddress(recipientAddress)]);
} else {
throw new Error(
`useTransactionDisplayData does not recognize transaction type. Type received is: ${type}`,
);
} }
const primaryCurrencyPreferences = useUserPreferencedCurrency(PRIMARY); const primaryCurrencyPreferences = useUserPreferencedCurrency(PRIMARY);