Skip to content

Commit

Permalink
fix: remove tx history on throwed route error
Browse files Browse the repository at this point in the history
Co-Authored-By: Zygimantas <[email protected]>
  • Loading branch information
grikomsn and Zygimantass committed Oct 26, 2023
1 parent 3db2a63 commit fe1373f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/TransactionDialog/TransactionDialogContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ import { useAccount } from "wagmi";

import { Chain, useChains } from "@/api/queries";
import { useToast } from "@/context/toast";
import { addTxHistory, addTxStatus, failTxHistory } from "@/context/tx-history";
import {
addTxHistory,
addTxStatus,
removeTxHistory,
} from "@/context/tx-history";
import Toast from "@/elements/Toast";
import { useSkipClient } from "@/solve";
import {
Expand Down Expand Up @@ -205,7 +209,7 @@ const TransactionDialogContent: FC<Props> = ({
setTxError(err.message);
setIsError(true);
}
failTxHistory(historyId);
removeTxHistory(historyId);
setTxStatuses((statuses) => {
const newStatuses = [...statuses];
return newStatuses.map((status) => {
Expand Down

0 comments on commit fe1373f

Please sign in to comment.