File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
ui/src/hooks/useReportModal Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,11 @@ const useReportModal = (callback?: () => void) => {
47
47
setShow ( true ) ;
48
48
} ) ;
49
49
} ;
50
-
50
+ const asyncCallback = ( ) => {
51
+ setTimeout ( ( ) => {
52
+ callback ?.( ) ;
53
+ } ) ;
54
+ } ;
51
55
const handleRadio = ( val ) => {
52
56
setInvalidState ( false ) ;
53
57
setContent ( {
@@ -93,8 +97,8 @@ const useReportModal = (callback?: () => void) => {
93
97
close_type : reportType . type ,
94
98
close_msg : content . value ,
95
99
} ) . then ( ( ) => {
96
- callback ?.( ) ;
97
100
onClose ( ) ;
101
+ asyncCallback ( ) ;
98
102
} ) ;
99
103
return ;
100
104
}
@@ -109,8 +113,8 @@ const useReportModal = (callback?: () => void) => {
109
113
msg : t ( 'flag_success' , { keyPrefix : 'toast' } ) ,
110
114
variant : 'warning' ,
111
115
} ) ;
112
- callback ?.( ) ;
113
116
onClose ( ) ;
117
+ asyncCallback ( ) ;
114
118
} ) ;
115
119
}
116
120
@@ -121,8 +125,8 @@ const useReportModal = (callback?: () => void) => {
121
125
flagged_type : reportType . type ,
122
126
id : params . id ,
123
127
} ) . then ( ( ) => {
124
- callback ?.( ) ;
125
128
onClose ( ) ;
129
+ asyncCallback ( ) ;
126
130
} ) ;
127
131
}
128
132
} ;
You can’t perform that action at this time.
0 commit comments