Skip to content

Commit

Permalink
address nits
Browse files Browse the repository at this point in the history
  • Loading branch information
aforaleka committed Sep 24, 2024
1 parent df351e3 commit 123ab1c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/hooks/useSubaccount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -579,8 +579,8 @@ const useSubaccountContext = ({ localDydxWallet }: { localDydxWallet?: LocalWall
data?: Nullable<HumanReadableCancelOrderPayload>
) => {
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) {
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions src/lib/abacus/dydxChainTransactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down

0 comments on commit 123ab1c

Please sign in to comment.