From d14eee25852e07b6fa19ad1a0163ef805276d780 Mon Sep 17 00:00:00 2001 From: shayan khaleghparast Date: Tue, 11 Jun 2024 15:28:03 +0800 Subject: [PATCH] ci: fixed build errors --- src/hooks/custom-hooks/useIsAdvertiser.ts | 2 +- src/pages/orders/screens/OrderDetails/OrderDetails.tsx | 2 +- .../AdvertiserInfoStateProvider.tsx | 3 +-- src/routes/AppContent/index.tsx | 1 - 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/hooks/custom-hooks/useIsAdvertiser.ts b/src/hooks/custom-hooks/useIsAdvertiser.ts index cfd49ef8..876d8238 100644 --- a/src/hooks/custom-hooks/useIsAdvertiser.ts +++ b/src/hooks/custom-hooks/useIsAdvertiser.ts @@ -12,7 +12,7 @@ const useIsAdvertiser = (): boolean => { const [isAdvertiser, setIsAdvertiser] = useState(!error && !isEmptyObject(data)); useEffect(() => { - if (error && error?.error.code === ERROR_CODES.ADVERTISER_NOT_FOUND) { + if (error && error?.code === ERROR_CODES.ADVERTISER_NOT_FOUND) { setIsAdvertiser(false); } else if (!error && !isEmptyObject(data)) { setIsAdvertiser(true); diff --git a/src/pages/orders/screens/OrderDetails/OrderDetails.tsx b/src/pages/orders/screens/OrderDetails/OrderDetails.tsx index ce2805fa..0d27edf2 100644 --- a/src/pages/orders/screens/OrderDetails/OrderDetails.tsx +++ b/src/pages/orders/screens/OrderDetails/OrderDetails.tsx @@ -80,7 +80,7 @@ const OrderDetails = () => { if (isLoading || (!orderInfo && !error)) return ; // TODO: replace with proper error screen once design is ready - if (error) return {error?.error?.message}; + if (error) return {error?.message}; if (isMobile) { return ( diff --git a/src/providers/AdvertiserInfoStateProvider/AdvertiserInfoStateProvider.tsx b/src/providers/AdvertiserInfoStateProvider/AdvertiserInfoStateProvider.tsx index d11efbc9..c26beb45 100644 --- a/src/providers/AdvertiserInfoStateProvider/AdvertiserInfoStateProvider.tsx +++ b/src/providers/AdvertiserInfoStateProvider/AdvertiserInfoStateProvider.tsx @@ -1,8 +1,7 @@ import { createContext, PropsWithChildren, useContext } from 'react'; -import { TSocketError } from 'types'; type TContextValue = { - error: TSocketError<'p2p_advertiser_info'> | undefined; + error: { code: string; message: string } | undefined; isIdle: boolean; isLoading: boolean; isSubscribed: boolean; diff --git a/src/routes/AppContent/index.tsx b/src/routes/AppContent/index.tsx index d98b4c34..ac0d1fb8 100644 --- a/src/routes/AppContent/index.tsx +++ b/src/routes/AppContent/index.tsx @@ -51,7 +51,6 @@ const AppContent = () => { useEffect(() => { if (hasCreatedAdvertiser) { // Need to pass params to subscribeAdvertiserInfo to trigger the subscription. - // @ts-expect-error - passthrough is not a valid parameter subscribeAdvertiserInfo({ passthrough: { createdNickname: 'nickname' } }); } }, [hasCreatedAdvertiser, subscribeAdvertiserInfo]);