File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -4,16 +4,21 @@ import ErrorScreenTemplate from './ErrorScreenTemplate';
4
4
import { undrawBugFixing } from '../../static/images' ;
5
5
import { useHistory } from 'react-router-dom' ;
6
6
7
- export type CrashErrorScreenProps = { } ;
7
+ export type CrashErrorScreenProps = {
8
+ onResolve : ( ) => void ;
9
+ } ;
8
10
9
- function CrashErrorScreen ( props : CrashErrorScreenProps ) {
11
+ function CrashErrorScreen ( { onResolve } : CrashErrorScreenProps ) {
10
12
const history = useHistory ( ) ;
11
13
return (
12
14
< ErrorScreenTemplate
13
15
image = { undrawBugFixing }
14
16
message = "엇! 오류가 발생했습니다."
15
17
buttonText = "홈으로"
16
- onButtonClick = { ( ) => history . push ( '/' ) }
18
+ onButtonClick = { ( ) => {
19
+ history . push ( '/' ) ;
20
+ onResolve ( ) ;
21
+ } }
17
22
/>
18
23
) ;
19
24
}
Original file line number Diff line number Diff line change @@ -23,12 +23,18 @@ class ErrorBoundary extends React.Component {
23
23
Sentry . captureException ( error ) ;
24
24
}
25
25
}
26
+
27
+ handleResolveError = ( ) => {
28
+ this . setState ( {
29
+ hasError : false ,
30
+ } ) ;
31
+ } ;
26
32
render ( ) {
27
33
if ( this . state . chunkError ) {
28
34
return < ChunkErrorScreen /> ;
29
35
}
30
36
if ( this . state . hasError ) {
31
- return < CrashErrorScreen /> ;
37
+ return < CrashErrorScreen onResolve = { this . handleResolveError } /> ;
32
38
}
33
39
return (
34
40
< ErrorBoundaryWrapper hasError = { this . state . hasError } >
You can’t perform that action at this time.
0 commit comments