Skip to content

Commit

Permalink
Don't throw route error in useScopeParam to fix opening "/abc/xyz" URL
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaw3d committed Jan 19, 2024
1 parent 13e6af3 commit 6cc668f
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/app/hooks/useScopeParam.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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
}

Expand Down

0 comments on commit 6cc668f

Please sign in to comment.