Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
abrzezinski94 committed Aug 7, 2024
1 parent 2d5a9e0 commit 29500af
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions components/swap/SwapReviewRouteInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,7 @@ const SwapReviewRouteInfo = ({
description: e.message,
txid: e?.txid,
type: 'error',
noSentry: true,
})
}
} else {
Expand All @@ -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,
})
}
}
Expand Down
2 changes: 2 additions & 0 deletions components/swap/SwapTriggerOrders.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export const handleCancelTriggerOrder = async (
description: e.message,
txid: e?.txid,
type: 'error',
noSentry: true,
})
}
}
Expand Down Expand Up @@ -118,6 +119,7 @@ export const handleCancelAll = async (
description: e.message,
txid: e?.txid,
type: 'error',
noSentry: true,
})
}
}
Expand Down
1 change: 1 addition & 0 deletions components/trade/AdvancedTradeForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,7 @@ const AdvancedTradeForm = () => {
description: e.message,
txid: e?.txid,
type: 'error',
noSentry: true,
})
} finally {
setPlacingOrder(false)
Expand Down
3 changes: 3 additions & 0 deletions components/trade/SpotMarketOrderSwapForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -333,20 +333,23 @@ export default function SpotMarketOrderSwapForm() {
description: t('swap:error-slippage-exceeded-desc'),
txid: e?.txid,
type: 'error',
noSentry: true,
})
} else {
notify({
title: 'Transaction failed',
description: e.message,
txid: e?.txid,
type: 'error',
noSentry: true,
})
}
} else {
notify({
title: 'Transaction failed',
description: `${e} - please try again`,
type: 'error',
noSentry: true,
})
}
} finally {
Expand Down
3 changes: 2 additions & 1 deletion utils/notifications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down
1 change: 1 addition & 0 deletions utils/tradeForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ export const handlePlaceTriggerOrder = async (
description: e.message,
txid: e?.txid,
type: 'error',
noSentry: true,
})
}
}
Expand Down

0 comments on commit 29500af

Please sign in to comment.