From 29500afcdd11de4805381ccaa0f49c799a39b41c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Brzezin=CC=81ski?= Date: Wed, 7 Aug 2024 22:19:34 +0200 Subject: [PATCH] fix --- components/swap/SwapReviewRouteInfo.tsx | 3 +++ components/swap/SwapTriggerOrders.tsx | 2 ++ components/trade/AdvancedTradeForm.tsx | 1 + components/trade/SpotMarketOrderSwapForm.tsx | 3 +++ utils/notifications.ts | 3 ++- utils/tradeForm.ts | 1 + 6 files changed, 12 insertions(+), 1 deletion(-) diff --git a/components/swap/SwapReviewRouteInfo.tsx b/components/swap/SwapReviewRouteInfo.tsx index 860a3f68a..ab225ec17 100644 --- a/components/swap/SwapReviewRouteInfo.tsx +++ b/components/swap/SwapReviewRouteInfo.tsx @@ -565,6 +565,7 @@ const SwapReviewRouteInfo = ({ description: e.message, txid: e?.txid, type: 'error', + noSentry: true, }) } } else { @@ -586,12 +587,14 @@ const SwapReviewRouteInfo = ({ title: 'Transaction failed', description: `${stringError} - please review route and click swap again`, type: 'error', + noSentry: true, }) } else { notify({ title: 'Transaction failed', description: `${stringError} - please try again`, type: 'error', + noSentry: true, }) } } diff --git a/components/swap/SwapTriggerOrders.tsx b/components/swap/SwapTriggerOrders.tsx index 9251c1b46..07ef666fb 100644 --- a/components/swap/SwapTriggerOrders.tsx +++ b/components/swap/SwapTriggerOrders.tsx @@ -72,6 +72,7 @@ export const handleCancelTriggerOrder = async ( description: e.message, txid: e?.txid, type: 'error', + noSentry: true, }) } } @@ -118,6 +119,7 @@ export const handleCancelAll = async ( description: e.message, txid: e?.txid, type: 'error', + noSentry: true, }) } } diff --git a/components/trade/AdvancedTradeForm.tsx b/components/trade/AdvancedTradeForm.tsx index a01eaab2b..54647dd34 100644 --- a/components/trade/AdvancedTradeForm.tsx +++ b/components/trade/AdvancedTradeForm.tsx @@ -807,6 +807,7 @@ const AdvancedTradeForm = () => { description: e.message, txid: e?.txid, type: 'error', + noSentry: true, }) } finally { setPlacingOrder(false) diff --git a/components/trade/SpotMarketOrderSwapForm.tsx b/components/trade/SpotMarketOrderSwapForm.tsx index 6616c9e34..951ddafb1 100644 --- a/components/trade/SpotMarketOrderSwapForm.tsx +++ b/components/trade/SpotMarketOrderSwapForm.tsx @@ -333,6 +333,7 @@ export default function SpotMarketOrderSwapForm() { description: t('swap:error-slippage-exceeded-desc'), txid: e?.txid, type: 'error', + noSentry: true, }) } else { notify({ @@ -340,6 +341,7 @@ export default function SpotMarketOrderSwapForm() { description: e.message, txid: e?.txid, type: 'error', + noSentry: true, }) } } else { @@ -347,6 +349,7 @@ export default function SpotMarketOrderSwapForm() { title: 'Transaction failed', description: `${e} - please try again`, type: 'error', + noSentry: true, }) } } finally { diff --git a/utils/notifications.ts b/utils/notifications.ts index f20b2a435..732c44819 100644 --- a/utils/notifications.ts +++ b/utils/notifications.ts @@ -39,6 +39,7 @@ export function notify(newNotification: { txid?: string noSound?: boolean noMangoIdlEnrichment?: boolean + noSentry?: boolean }) { const setMangoStore = mangoStore.getState().set const notifications = mangoStore.getState().transactionNotifications @@ -48,7 +49,7 @@ export function notify(newNotification: { const soundSettings = savedSoundSettings ? JSON.parse(savedSoundSettings) : INITIAL_SOUND_SETTINGS - if (newNotification.type === 'error') { + if (newNotification.type === 'error' && !newNotification.noSentry) { sentry.captureException( { title: newNotification.title, diff --git a/utils/tradeForm.ts b/utils/tradeForm.ts index e4ae45815..98343dd7c 100644 --- a/utils/tradeForm.ts +++ b/utils/tradeForm.ts @@ -189,6 +189,7 @@ export const handlePlaceTriggerOrder = async ( description: e.message, txid: e?.txid, type: 'error', + noSentry: true, }) } }