remove cached yes for negative discount during bond purchase; avoid error toast on user rejection of tx

Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
This commit is contained in:
Uncle Stretch 2026-11-14 17:02:20 +03:00
parent 096256794f
commit c89da3c744
Signed by: str3tch
GPG Key ID: 84F3190747EE79AA
3 changed files with 14 additions and 4 deletions

View File

@ -1,7 +1,7 @@
{
"name": "ghost-dao-interface",
"private": true,
"version": "0.8.15",
"version": "0.8.16",
"type": "module",
"scripts": {
"dev": "vite",

View File

@ -152,6 +152,7 @@ export const BondConfirmModal = ({
const handleConfirmCloseMaster = () => {
setAcknowledgedWarmup(false);
setAcknowledgedNegativeDiscount(needsNegativeRoiCheck);
handleConfirmClose()
}

View File

@ -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;
}
}