File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55 QueryClient ,
66 QueryClientProvider ,
77} from "@tanstack/react-query" ;
8+ import { useRouter } from "next/navigation" ;
89import { ReactNode , useState } from "react" ;
910
1011// import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
@@ -14,6 +15,7 @@ type Props = {
1415} ;
1516
1617const Providers = ( { children } : Props ) => {
18+ const router = useRouter ( ) ;
1719 const [ client ] = useState (
1820 new QueryClient ( {
1921 defaultOptions : {
@@ -27,8 +29,10 @@ const Providers = ({ children }: Props) => {
2729 onError : ( error , query ) => {
2830 if ( query . meta && query . meta . errorMessage ) {
2931 console . error ( `${ query . meta . errorMessage } ` ) ;
32+ router . push ( "/not-found" ) ;
3033 } else {
3134 console . error ( `Something went wrong: ${ error . message } ` ) ;
35+ router . push ( "/not-found" ) ;
3236 }
3337 } ,
3438 } ) ,
Original file line number Diff line number Diff line change 22
33import { Button } from "@/shared/ui" ;
44import Image from "next/image" ;
5+ import { useRouter } from "next/navigation" ;
6+ import { useState } from "react" ;
57
68const NotFoundTyping = ( ) => {
9+ const [ isRouterBack , setIsRouterBack ] = useState ( false ) ;
10+ const router = useRouter ( ) ;
711 return (
812 < div className = "flex flex-col items-center justify-center text-center w-full min-h-[calc(100vh_-_68px)] gap-5" >
913 < div >
@@ -23,7 +27,13 @@ const NotFoundTyping = () => {
2327 < div >
2428 < Button
2529 className = "bg-black rounded-[100px]"
26- onClick = { ( ) => window . location . reload ( ) }
30+ onClick = { ( ) => {
31+ router . back ( ) ;
32+ setIsRouterBack ( true ) ;
33+ if ( isRouterBack ) {
34+ window . location . reload ( ) ;
35+ }
36+ } }
2737 >
2838 다시 시도
2939 </ Button >
Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ const TypingHeader = () => {
111111 ) }
112112 < div className = "text-lg font-black cursor-pointer" > { renderTitle ( ) } </ div >
113113 { isRenderLogin ( ) && (
114- < div className = "w-6" >
114+ < div className = "w-6 cursor-pointer " >
115115 < div onClick = { ( ) => router . push ( "/login" ) } >
116116 < TbLogin2 size = { 24 } />
117117 </ div >
You can’t perform that action at this time.
0 commit comments