From f6063449868bc9209f3bea23f3e2bab829d631c9 Mon Sep 17 00:00:00 2001 From: lukaw3d Date: Thu, 18 Jan 2024 05:22:31 +0100 Subject: [PATCH] Don't throw route error in useScopeParam to fix opening "/abc/xyz" URL --- src/app/hooks/useScopeParam.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/app/hooks/useScopeParam.ts b/src/app/hooks/useScopeParam.ts index 49b081935c..913ad0b12c 100644 --- a/src/app/hooks/useScopeParam.ts +++ b/src/app/hooks/useScopeParam.ts @@ -1,4 +1,4 @@ -import { useRouteLoaderData, useParams, useRouteError } from 'react-router-dom' +import { useRouteLoaderData, useParams } from 'react-router-dom' import { Network } from '../../types/network' import { AppError, AppErrors } from '../../types/errors' import { SearchScope } from '../../types/searchScope' @@ -14,9 +14,6 @@ export const useNetworkParam = (): Network | undefined => { export const useScopeParam = (): SearchScope | undefined => { const runtimeScope = useRouteLoaderData('runtimeScope') as SearchScope | undefined const consensusScope = useRouteLoaderData('consensusScope') as SearchScope | undefined - const error = useRouteError() - - if (error) throw error return runtimeScope ?? consensusScope ?? undefined }