File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,9 @@ const CimoDownloadNotice = props => {
5252 nonce : cimo . nonce ,
5353 } ) ,
5454 credentials : 'same-origin' ,
55- } ) . then ( res => res . json ( ) ) . then ( res => {
55+ } ) . then ( res => res . json ( ) ) . then ( res => {
56+ isPolling = false
57+
5658 if ( ! res . success ) {
5759 setData ( { status : 'error' , action : '' } )
5860
@@ -85,17 +87,18 @@ const CimoDownloadNotice = props => {
8587 ( action === 'install' && ( _data . status === 'installed' || _data . status === 'activated' ) ) ||
8688 ( action === 'activate' && _data . status === 'activated' )
8789 ) {
88- isPolling = false
8990 return
9091 }
9192
9293 setTimeout ( ( ) => {
9394 pollStatus ( action )
9495 } , 3000 * pollCountRef . current )
95- } ) . catch ( e => {
96+ } ) . catch ( e => {
9697 // eslint-disable-next-line no-console
9798 console . error ( e . message )
98- } )
99+ } ) . finally ( ( ) => {
100+ isPolling = false
101+ } )
99102 }
100103
101104 useEffect ( ( ) => {
You can’t perform that action at this time.
0 commit comments