From c3b99a5921a9892d83201cc5c85447934c6a02e0 Mon Sep 17 00:00:00 2001 From: Dan J Miller Date: Fri, 14 May 2021 18:33:14 -0230 Subject: [PATCH] Throw error if transaction type is not recognized by useTransactionDisplay data (#11104) --- ui/app/hooks/useTransactionDisplayData.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ui/app/hooks/useTransactionDisplayData.js b/ui/app/hooks/useTransactionDisplayData.js index f14088437..ea886205e 100644 --- a/ui/app/hooks/useTransactionDisplayData.js +++ b/ui/app/hooks/useTransactionDisplayData.js @@ -220,6 +220,10 @@ export function useTransactionDisplayData(transactionGroup) { category = TRANSACTION_GROUP_CATEGORIES.SEND; title = t('send'); subtitle = t('toAddress', [shortenAddress(recipientAddress)]); + } else { + throw new Error( + `useTransactionDisplayData does not recognize transaction type. Type received is: ${type}`, + ); } const primaryCurrencyPreferences = useUserPreferencedCurrency(PRIMARY);