File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change 1- import React , { useState , useEffect } from 'react' ;
1+ import React , { useState , useEffect } from 'react' ;
22import Link from '@docusaurus/Link' ;
33import Head from '@docusaurus/Head' ;
44import { Redirect as DocusaurusRedirect } from '@docusaurus/router' ;
@@ -20,16 +20,15 @@ const isValidUrl = (url: string): boolean => {
2020const Redirect : React . FC < RedirectProps > = ( props ) => {
2121 const [ manualRedirect , setManualRedirect ] = useState ( false ) ;
2222
23- if ( ! isValidUrl ( props . href ) ) {
24- console . error ( 'Invalid redirect URL:' , props . href ) ;
25- return < DocusaurusRedirect to = "/404" /> ;
26- }
27-
2823 useEffect ( ( ) => {
2924 const timer = setTimeout ( ( ) => setManualRedirect ( true ) , 3000 ) ;
3025 return ( ) => clearTimeout ( timer ) ;
3126 } , [ ] ) ;
3227
28+ if ( ! isValidUrl ( props . href ) ) {
29+ return < DocusaurusRedirect to = "/404" /> ;
30+ }
31+
3332 return (
3433 < >
3534 < Head >
You can’t perform that action at this time.
0 commit comments