diff --git a/package.json b/package.json index 4be941b..bac4996 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ghost-dao-interface", "private": true, - "version": "0.8.15", + "version": "0.8.16", "type": "module", "scripts": { "dev": "vite", diff --git a/src/containers/Bond/components/BondConfirmModal.jsx b/src/containers/Bond/components/BondConfirmModal.jsx index 17acc6d..df7ff6f 100644 --- a/src/containers/Bond/components/BondConfirmModal.jsx +++ b/src/containers/Bond/components/BondConfirmModal.jsx @@ -152,6 +152,7 @@ export const BondConfirmModal = ({ const handleConfirmCloseMaster = () => { setAcknowledgedWarmup(false); + setAcknowledgedNegativeDiscount(needsNegativeRoiCheck); handleConfirmClose() } diff --git a/src/hooks/helpers.js b/src/hooks/helpers.js index 6f8dd36..861647b 100644 --- a/src/hooks/helpers.js +++ b/src/hooks/helpers.js @@ -1,4 +1,5 @@ import toast from "react-hot-toast"; +import { BaseError, UserRejectedRequestError } from 'viem'; import { simulateContract, writeContract, waitForTransactionReceipt } from "@wagmi/core"; import { @@ -254,9 +255,17 @@ export const executeOnChainTransaction = async ({ return txHash; } catch (err) { - console.error(err); - toast.error(messages.errorMsg) - return undefined; + if (err instanceof BaseError) { + const rejectionError = err.walk((e) => e instanceof UserRejectedRequestError); + + if (rejectionError) { + console.log("User rejected the transaction in their wallet."); + return undefined; + } + } + + toast.error(messages.errorMsg) + return undefined; } }