diff --git a/src/hooks/useSubaccount.tsx b/src/hooks/useSubaccount.tsx index 17ca20419..884d2075a2 100644 --- a/src/hooks/useSubaccount.tsx +++ b/src/hooks/useSubaccount.tsx @@ -579,8 +579,8 @@ const useSubaccountContext = ({ localDydxWallet }: { localDydxWallet?: LocalWall data?: Nullable ) => { const matchedOrder = orders?.find((order) => order.id === data?.orderId); - // confirmed does not necessarily mean short term orders are successfully canceled - // therefore we only update the canceled orders count from indexer response + // ##OrderOnlyConfirmedCancelViaIndexer: success here does not necessarily mean orders are successfully canceled, + // we use indexer response as source of truth on whether the order is actually canceled if (!success) { const errorParams = getValidErrorParamsFromParsingError(parsingError); if (matchedOrder) { @@ -619,6 +619,8 @@ const useSubaccountContext = ({ localDydxWallet }: { localDydxWallet?: LocalWall const cancelOrderPayloads = data?.cancelOrderPayloads.toArray() ?? []; if (success) { + // #OrderOnlyConfirmedCancelViaIndexer + // even though trigger orders are probably confirmed canceled, we use indexer as source of truth to trigger order status toast onSuccess?.(); } else { const errorParams = getValidErrorParamsFromParsingError(parsingError); diff --git a/src/lib/abacus/dydxChainTransactions.ts b/src/lib/abacus/dydxChainTransactions.ts index c5d089352..afae31973 100644 --- a/src/lib/abacus/dydxChainTransactions.ts +++ b/src/lib/abacus/dydxChainTransactions.ts @@ -38,8 +38,6 @@ import { UNCOMMITTED_ORDER_TIMEOUT_MS } from '@/constants/trade'; import { DydxAddress } from '@/constants/wallets'; import { type RootStore } from '@/state/_store'; -// TODO Fix cycle -// eslint-disable-next-line import/no-cycle import { setInitializationError } from '@/state/app'; import { placeOrderTimeout } from '@/state/localOrders';