diff --git a/src/components/pools/contract-functions.ts b/src/components/pools/contract-functions.ts index cd362ea..a1aa2aa 100644 --- a/src/components/pools/contract-functions.ts +++ b/src/components/pools/contract-functions.ts @@ -274,8 +274,9 @@ export const addPoolVoucher = async ( export const removePoolVoucher = async ( voucherAddress: `0x${string}`, - tokenIndexAddress: `0x${string}` + swapPoolAddress: `0x${string}` ) => { + const tokenIndexAddress = await getSwapPoolTokenIndex(swapPoolAddress); const contract = { address: tokenIndexAddress, abi: tokenIndexABI }; const tx = await writeContract(config, { ...contract, diff --git a/src/components/pools/forms/pool-voucher-form.tsx b/src/components/pools/forms/pool-voucher-form.tsx index 07a7c2a..d9d5de2 100644 --- a/src/components/pools/forms/pool-voucher-form.tsx +++ b/src/components/pools/forms/pool-voucher-form.tsx @@ -109,10 +109,6 @@ export function PoolVoucherForm({ }); toast.success("Removed voucher from pool", { id, duration: undefined }); - await queryClient.invalidateQueries({ - queryKey: ["swapPool"], - refetchType: "all", - }); onSuccess(); } catch (error) { toast.error("Error removing voucher from pool", { id, duration: 4000 }); diff --git a/src/components/pools/hooks.tsx b/src/components/pools/hooks.tsx index 2aa5123..6c97f00 100644 --- a/src/components/pools/hooks.tsx +++ b/src/components/pools/hooks.tsx @@ -123,7 +123,7 @@ export const useRemovePoolVoucher = () => { void queryClient.invalidateQueries({ queryKey: ["swapPool", variables.swapPoolAddress, accountAddress], }); - }, 5000); + }, 10000); }, mutationFn: async ({ swapPoolAddress,