File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -92,6 +92,7 @@ const ReplayPage = () => {
92
92
const [ to , setTo ] = useState ( ) ;
93
93
const [ expanded , setExpanded ] = useState ( true ) ;
94
94
const [ playing , setPlaying ] = useState ( false ) ;
95
+ const [ loading , setLoading ] = useState ( false ) ;
95
96
96
97
const deviceName = useSelector ( ( state ) => {
97
98
if ( selectedDeviceId ) {
@@ -131,6 +132,7 @@ const ReplayPage = () => {
131
132
} , [ setShowCard ] ) ;
132
133
133
134
const handleSubmit = useCatch ( async ( { deviceId, from, to } ) => {
135
+ setLoading ( true ) ;
134
136
setSelectedDeviceId ( deviceId ) ;
135
137
setFrom ( from ) ;
136
138
setTo ( to ) ;
@@ -140,12 +142,14 @@ const ReplayPage = () => {
140
142
setIndex ( 0 ) ;
141
143
const positions = await response . json ( ) ;
142
144
setPositions ( positions ) ;
145
+ setLoading ( false ) ;
143
146
if ( positions . length ) {
144
147
setExpanded ( false ) ;
145
148
} else {
146
149
throw Error ( t ( 'sharedNoData' ) ) ;
147
150
}
148
151
} else {
152
+ setLoading ( false ) ;
149
153
throw Error ( await response . text ( ) ) ;
150
154
}
151
155
} ) ;
@@ -213,7 +217,7 @@ const ReplayPage = () => {
213
217
</ div >
214
218
</ >
215
219
) : (
216
- < ReportFilter handleSubmit = { handleSubmit } fullScreen showOnly />
220
+ < ReportFilter handleSubmit = { handleSubmit } fullScreen showOnly loading = { loading } />
217
221
) }
218
222
</ Paper >
219
223
</ div >
You can’t perform that action at this time.
0 commit comments