From 14ba6c4eb15f8549817240cd598bd065e84820e7 Mon Sep 17 00:00:00 2001 From: Adam Gall Date: Tue, 12 Mar 2024 11:21:51 -0400 Subject: [PATCH] Don't log or show Price API communication errors in development --- src/providers/App/hooks/usePriceAPI.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/providers/App/hooks/usePriceAPI.ts b/src/providers/App/hooks/usePriceAPI.ts index 28fc0f8494..1ee58adbaf 100644 --- a/src/providers/App/hooks/usePriceAPI.ts +++ b/src/providers/App/hooks/usePriceAPI.ts @@ -41,6 +41,9 @@ export default function usePriceAPI() { } } } catch (e) { + // When doing local development, it's unlikely that the Pricing Service is going to be running locally, + // so don't worry about logging or showing the error toast. + if (process.env.NODE_ENV === 'development') return; logError('Error while getting tokens prices', e); toast.warning(t('tokenPriceFetchingError')); return;