Skip to content

Commit

Permalink
remove extra notifications when using useTransactor (scaffold-eth#766)
Browse files Browse the repository at this point in the history
  • Loading branch information
technophile-04 authored Mar 11, 2024
1 parent 70e48aa commit 6d0ac6c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {
import { IntegerInput } from "~~/components/scaffold-eth";
import { useTransactor } from "~~/hooks/scaffold-eth";
import { useTargetNetwork } from "~~/hooks/scaffold-eth/useTargetNetwork";
import { getParsedError, notification } from "~~/utils/scaffold-eth";

type WriteOnlyFunctionFormProps = {
abi: Abi;
Expand Down Expand Up @@ -58,8 +57,7 @@ export const WriteOnlyFunctionForm = ({
await writeTxn(makeWriteWithParams);
onChange();
} catch (e: any) {
const message = getParsedError(e);
notification.error(message);
console.error("⚡️ ~ file: WriteOnlyFunctionForm.tsx:handleWrite ~ error", e);
}
}
};
Expand Down
4 changes: 1 addition & 3 deletions packages/nextjs/components/scaffold-eth/Faucet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { useNetwork } from "wagmi";
import { BanknotesIcon } from "@heroicons/react/24/outline";
import { Address, AddressInput, Balance, EtherInput } from "~~/components/scaffold-eth";
import { useTransactor } from "~~/hooks/scaffold-eth";
import { getParsedError, notification } from "~~/utils/scaffold-eth";
import { notification } from "~~/utils/scaffold-eth";

// Account index to use from generated hardhat accounts.
const FAUCET_ACCOUNT_INDEX = 0;
Expand Down Expand Up @@ -70,9 +70,7 @@ export const Faucet = () => {
setInputAddress(undefined);
setSendValue("");
} catch (error) {
const parsedError = getParsedError(error);
console.error("⚡️ ~ file: Faucet.tsx:sendETH ~ error", error);
notification.error(parsedError);
setLoading(false);
}
};
Expand Down

0 comments on commit 6d0ac6c

Please sign in to comment.