From f7b504cea7689e532e241129ef02e44d0ac1b924 Mon Sep 17 00:00:00 2001 From: Reckless_Satoshi Date: Mon, 15 Jan 2024 09:33:47 +0000 Subject: [PATCH] Minor lint fixes --- frontend/src/basic/MainDialogs/index.tsx | 3 +-- frontend/src/basic/NavBar/NavBar.tsx | 6 +++--- frontend/src/basic/OrderPage/index.tsx | 1 - frontend/src/basic/RobotPage/RobotProfile.tsx | 2 +- frontend/src/components/Dialogs/Coordinator.tsx | 8 +++++--- frontend/src/components/RobotInfo/index.tsx | 2 +- frontend/src/contexts/AppContext.tsx | 2 +- frontend/src/contexts/FederationContext.tsx | 2 +- frontend/src/contexts/GarageContext.tsx | 2 +- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/frontend/src/basic/MainDialogs/index.tsx b/frontend/src/basic/MainDialogs/index.tsx index a13151b6..c924e41c 100644 --- a/frontend/src/basic/MainDialogs/index.tsx +++ b/frontend/src/basic/MainDialogs/index.tsx @@ -26,8 +26,7 @@ export interface OpenDialogs { } const MainDialogs = (): JSX.Element => { - const { open, setOpen, settings, clientVersion, hostUrl } = - useContext(AppContext); + const { open, setOpen, settings, clientVersion } = useContext(AppContext); const { federation } = useContext(FederationContext); return ( diff --git a/frontend/src/basic/NavBar/NavBar.tsx b/frontend/src/basic/NavBar/NavBar.tsx index 7d25b634..b5a292e9 100644 --- a/frontend/src/basic/NavBar/NavBar.tsx +++ b/frontend/src/basic/NavBar/NavBar.tsx @@ -17,14 +17,14 @@ import { import RobotAvatar from '../../components/RobotAvatar'; import { AppContext, type UseAppStoreType, closeAll } from '../../contexts/AppContext'; import { GarageContext, type UseGarageStoreType } from '../../contexts/GarageContext'; -import { FederationContext, UseFederationStoreType } from '../../contexts/FederationContext'; +import { FederationContext, type UseFederationStoreType } from '../../contexts/FederationContext'; const NavBar = (): JSX.Element => { const theme = useTheme(); const { t } = useTranslation(); const { page, setPage, settings, setSlideDirection, open, setOpen, windowSize, navbarHeight } = useContext(AppContext); - const { garage, orderUpdatedAt, robotUpdatedAt } = useContext(GarageContext); + const { garage, robotUpdatedAt } = useContext(GarageContext); const { setCurrentOrderId } = useContext(FederationContext); const navigate = useNavigate(); @@ -82,7 +82,7 @@ const NavBar = (): JSX.Element => { const lastOrderId = slot?.getRobot(slot?.lastShortAlias ?? '')?.lastOrderId; const param = newPage === 'order' ? `${shortAlias}/${String(activeOrderId ?? lastOrderId)}` : ''; - if (shortAlias && (activeOrderId || lastOrderId)) { + if (newPage === 'order') { setCurrentOrderId({ id: activeOrderId ?? lastOrderId, shortAlias }); } setTimeout(() => { diff --git a/frontend/src/basic/OrderPage/index.tsx b/frontend/src/basic/OrderPage/index.tsx index 2e42e6cd..53b79f82 100644 --- a/frontend/src/basic/OrderPage/index.tsx +++ b/frontend/src/basic/OrderPage/index.tsx @@ -9,7 +9,6 @@ import OrderDetails from '../../components/OrderDetails'; import { AppContext, closeAll, type UseAppStoreType } from '../../contexts/AppContext'; import { FederationContext, type UseFederationStoreType } from '../../contexts/FederationContext'; import { GarageContext, type UseGarageStoreType } from '../../contexts/GarageContext'; -import { type Order } from '../../models'; import { WarningDialog } from '../../components/Dialogs'; const OrderPage = (): JSX.Element => { diff --git a/frontend/src/basic/RobotPage/RobotProfile.tsx b/frontend/src/basic/RobotPage/RobotProfile.tsx index 36370fe4..9c0d472e 100644 --- a/frontend/src/basic/RobotPage/RobotProfile.tsx +++ b/frontend/src/basic/RobotPage/RobotProfile.tsx @@ -22,7 +22,7 @@ import { AppContext, type UseAppStoreType } from '../../contexts/AppContext'; import { genBase62Token } from '../../utils'; import { LoadingButton } from '@mui/lab'; import { GarageContext, type UseGarageStoreType } from '../../contexts/GarageContext'; -import { FederationContext, UseFederationStoreType } from '../../contexts/FederationContext'; +import { FederationContext, type UseFederationStoreType } from '../../contexts/FederationContext'; interface RobotProfileProps { robot: Robot; diff --git a/frontend/src/components/Dialogs/Coordinator.tsx b/frontend/src/components/Dialogs/Coordinator.tsx index bbfe47ba..f946b858 100644 --- a/frontend/src/components/Dialogs/Coordinator.tsx +++ b/frontend/src/components/Dialogs/Coordinator.tsx @@ -654,9 +654,11 @@ const CoordinatorDialog = ({ open = false, onClose, network, shortAlias }: Props } rel='noreferrer' > - {`${coordinator?.[settings.network][ - settings.selfhostedClient ? 'onion' : origin - ]}`} + {`${String( + coordinator?.[settings.network][ + settings.selfhostedClient ? 'onion' : origin + ], + )}`} diff --git a/frontend/src/components/RobotInfo/index.tsx b/frontend/src/components/RobotInfo/index.tsx index 59cc97c8..8d2d2f9e 100644 --- a/frontend/src/components/RobotInfo/index.tsx +++ b/frontend/src/components/RobotInfo/index.tsx @@ -31,7 +31,7 @@ import { UserNinjaIcon } from '../Icons'; import { getWebln } from '../../utils'; import { signCleartextMessage } from '../../pgp'; import { GarageContext, type UseGarageStoreType } from '../../contexts/GarageContext'; -import { FederationContext, UseFederationStoreType } from '../../contexts/FederationContext'; +import { FederationContext, type UseFederationStoreType } from '../../contexts/FederationContext'; interface Props { coordinator: Coordinator; diff --git a/frontend/src/contexts/AppContext.tsx b/frontend/src/contexts/AppContext.tsx index 5b50cb17..b2bb3035 100644 --- a/frontend/src/contexts/AppContext.tsx +++ b/frontend/src/contexts/AppContext.tsx @@ -4,7 +4,7 @@ import React, { useEffect, useState, type SetStateAction, - ReactNode, + type ReactNode, } from 'react'; import { type Page } from '../basic/NavBar'; import { type OpenDialogs } from '../basic/MainDialogs'; diff --git a/frontend/src/contexts/FederationContext.tsx b/frontend/src/contexts/FederationContext.tsx index a926e4e5..deae8ef0 100644 --- a/frontend/src/contexts/FederationContext.tsx +++ b/frontend/src/contexts/FederationContext.tsx @@ -6,7 +6,7 @@ import React, { type SetStateAction, useMemo, useContext, - ReactNode, + type ReactNode, } from 'react'; import { type Order, Federation } from '../models'; diff --git a/frontend/src/contexts/GarageContext.tsx b/frontend/src/contexts/GarageContext.tsx index 6f6ae270..3d5289ec 100644 --- a/frontend/src/contexts/GarageContext.tsx +++ b/frontend/src/contexts/GarageContext.tsx @@ -4,7 +4,7 @@ import React, { useState, type SetStateAction, useEffect, - ReactNode, + type ReactNode, } from 'react'; import { defaultMaker, type Maker, Garage } from '../models';