Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tyleroooo committed Dec 19, 2024
1 parent 4a7d605 commit 8272b47
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions src/hooks/useSeen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import { setSeenFills, setSeenOpenOrders, setSeenOrderHistory } from '@/state/ac
import { getSelectedNetwork } from '@/state/appSelectors';
import { useAppDispatch, useAppSelector } from '@/state/appTypes';

import { assertNever } from '@/lib/assertNever';

export function useViewPanel(
market: string | undefined,
kind: 'fills' | 'openOrders' | 'orderHistory'
Expand All @@ -20,15 +18,13 @@ export function useViewPanel(
const lastSetCore = useRef<any[]>([]);

const dispatch = useAppDispatch();
const actionCreator =
kind === 'fills'
? setSeenFills
: kind === 'openOrders'
? setSeenOpenOrders
: // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
kind === 'orderHistory'
? setSeenOrderHistory
: assertNever(kind);
const actionCreator = (
{
fills: setSeenFills,
openOrders: setSeenOpenOrders,
orderHistory: setSeenOrderHistory,
} as const
)[kind];

const componentWillUnmount = useComponentWillUnmount();

Expand Down

0 comments on commit 8272b47

Please sign in to comment.