diff --git a/frontend/src/basic/OrderPage/index.tsx b/frontend/src/basic/OrderPage/index.tsx index 20f8adf4..aa2f3e74 100644 --- a/frontend/src/basic/OrderPage/index.tsx +++ b/frontend/src/basic/OrderPage/index.tsx @@ -40,14 +40,14 @@ const OrderPage = (): JSX.Element => { const shortAlias = params.shortAlias; const coordinator = federation.getCoordinator(shortAlias ?? ''); if (coordinator) { - const { url, basePath } = coordinator?.getEndpoint( + const endpoint = coordinator?.getEndpoint( settings.network, origin, settings.selfhostedClient, hostUrl, ); - setBaseUrl(`${url}${basePath}`); + if (endpoint) setBaseUrl(`${endpoint?.url}${endpoint?.basePath}`); const orderId = Number(params.orderId); if ( diff --git a/frontend/src/basic/RobotPage/RobotProfile.tsx b/frontend/src/basic/RobotPage/RobotProfile.tsx index 55bd5fe7..4095d41a 100644 --- a/frontend/src/basic/RobotPage/RobotProfile.tsx +++ b/frontend/src/basic/RobotPage/RobotProfile.tsx @@ -156,7 +156,7 @@ const RobotProfile = ({ )} - {loadingCoordinators > 0 && !Boolean(robot?.activeOrderId) ? ( + {loadingCoordinators > 0 && !robot?.activeOrderId ? ( {t('Looking for orders!')} @@ -210,9 +210,9 @@ const RobotProfile = ({ ) : null} - {!Boolean(robot?.activeOrderId) && + {!robot?.activeOrderId && slot?.hashId && - !Boolean(robot?.lastOrderId) && + !robot?.lastOrderId && loadingCoordinators === 0 ? ( {t('No existing orders found')} ) : null} diff --git a/frontend/src/basic/SettingsPage/index.tsx b/frontend/src/basic/SettingsPage/index.tsx index e54d1c07..a47360e5 100644 --- a/frontend/src/basic/SettingsPage/index.tsx +++ b/frontend/src/basic/SettingsPage/index.tsx @@ -4,7 +4,7 @@ import SettingsForm from '../../components/SettingsForm'; import { AppContext, type UseAppStoreType } from '../../contexts/AppContext'; import FederationTable from '../../components/FederationTable'; import { t } from 'i18next'; -import { FederationContext, UseFederationStoreType } from '../../contexts/FederationContext'; +import { FederationContext, type UseFederationStoreType } from '../../contexts/FederationContext'; const SettingsPage = (): JSX.Element => { const { windowSize, navbarHeight } = useContext(AppContext); @@ -16,7 +16,7 @@ const SettingsPage = (): JSX.Element => { // Regular expression to match a valid .onion URL const onionUrlPattern = /^((http|https):\/\/)?[a-zA-Z2-7]{16,56}\.onion$/; - const addCoordinator = () => { + const addCoordinator: () => void = () => { if (federation.coordinators[newAlias]) { setError(t('Alias already exists')); } else { @@ -65,7 +65,9 @@ const SettingsPage = (): JSX.Element => { variant='outlined' size='small' value={newAlias} - onChange={(e) => setNewAlias(e.target.value)} + onChange={(e) => { + setNewAlias(e.target.value); + }} /> { variant='outlined' size='small' value={newUrl} - onChange={(e) => setNewUrl(e.target.value)} + onChange={(e) => { + setNewUrl(e.target.value); + }} />