From 8272b47f66f76300ea27dc17daccc527bdef7e39 Mon Sep 17 00:00:00 2001 From: Tyler Date: Thu, 19 Dec 2024 13:23:30 -0500 Subject: [PATCH] fix --- src/hooks/useSeen.ts | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/hooks/useSeen.ts b/src/hooks/useSeen.ts index 9aac1bc81..6ae7934af 100644 --- a/src/hooks/useSeen.ts +++ b/src/hooks/useSeen.ts @@ -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' @@ -20,15 +18,13 @@ export function useViewPanel( const lastSetCore = useRef([]); 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();