fix(mod): loading mod edge case
All checks were successful
Release to Staging / build_and_release (push) Successful in 1m2s
All checks were successful
Release to Staging / build_and_release (push) Successful in 1m2s
Close #175 - Add timeout to requests and try again button
This commit is contained in:
parent
c6c2013f1e
commit
e15307be3b
@ -1,4 +1,4 @@
|
||||
import { Link, useRouteError } from 'react-router-dom'
|
||||
import { Link, useLocation, useRouteError } from 'react-router-dom'
|
||||
import { appRoutes } from 'routes'
|
||||
|
||||
interface NotFoundPageProps {
|
||||
@ -12,6 +12,8 @@ export const NotFoundPage = ({
|
||||
}: Partial<NotFoundPageProps>) => {
|
||||
const error = useRouteError() as Partial<NotFoundPageProps>
|
||||
|
||||
const location = useLocation()
|
||||
|
||||
return (
|
||||
<div className='InnerBodyMain'>
|
||||
<div className='ContainerMain'>
|
||||
@ -23,7 +25,19 @@ export const NotFoundPage = ({
|
||||
<div>
|
||||
<p>{error?.message || message}</p>
|
||||
</div>
|
||||
<div className='IBMSMAction'>
|
||||
<div
|
||||
className='IBMSMAction'
|
||||
style={{
|
||||
gap: '10px'
|
||||
}}
|
||||
>
|
||||
<Link
|
||||
to={location.pathname}
|
||||
className='btn btnMain IBMSMActionBtn'
|
||||
type='button'
|
||||
>
|
||||
Try again
|
||||
</Link>
|
||||
<Link
|
||||
to={appRoutes.home}
|
||||
className='btn btnMain IBMSMActionBtn'
|
||||
|
@ -20,7 +20,8 @@ import {
|
||||
getLocalStorageItem,
|
||||
getReportingSet,
|
||||
log,
|
||||
LogType
|
||||
LogType,
|
||||
timeout
|
||||
} from 'utils'
|
||||
|
||||
export const modRouteLoader =
|
||||
@ -84,8 +85,8 @@ export const modRouteLoader =
|
||||
|
||||
// Parallel fetch mod event, latest events, mute, nsfw, repost lists
|
||||
const settled = await Promise.allSettled([
|
||||
ndkContext.fetchEvent(modFilter),
|
||||
ndkContext.fetchEvents(latestFilter),
|
||||
Promise.race([ndkContext.fetchEvent(modFilter), timeout(2000)]),
|
||||
Promise.race([ndkContext.fetchEvents(latestFilter), timeout(2000)]),
|
||||
ndkContext.getMuteLists(loggedInUserPubkey), // Pass pubkey for logged-in users
|
||||
getReportingSet(CurationSetIdentifiers.NSFW, ndkContext),
|
||||
getReportingSet(CurationSetIdentifiers.Repost, ndkContext)
|
||||
|
Loading…
x
Reference in New Issue
Block a user