File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -79,9 +79,9 @@ export default class InternetReachability {
7979
8080 // Create promise that will reject after the request timeout has been reached
8181 let timeoutHandle : ReturnType < typeof setTimeout > ;
82- const timeoutPromise = new Promise < Response > ( ( ) : void => {
82+ const timeoutPromise = new Promise < Response > ( ( _ , reject ) : void => {
8383 timeoutHandle = setTimeout (
84- ( ) : void => controller . abort ( 'timedout' ) ,
84+ ( ) : void => reject ( 'timedout' ) ,
8585 this . _configuration . reachabilityRequestTimeout ,
8686 ) ;
8787 } ) ;
@@ -120,6 +120,10 @@ export default class InternetReachability {
120120 if ( 'canceled' === error ) {
121121 controller . abort ( ) ;
122122 } else {
123+ if ( 'timedout' === error ) {
124+ controller . abort ( ) ;
125+ }
126+
123127 this . _setIsInternetReachable ( false ) ;
124128 this . _currentTimeoutHandle = setTimeout (
125129 this . _checkInternetReachability ,
You can’t perform that action at this time.
0 commit comments