File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -54,20 +54,19 @@ class StaticServer {
54
54
55
55
this . started = false ;
56
56
this . _origin = undefined ;
57
+ this . _handleAppStateChangeFn = this . _handleAppStateChange . bind ( this ) ;
57
58
}
58
59
59
60
start ( ) {
60
61
if ( this . running ) {
61
- return new Promise ( ( resolve , reject ) => {
62
- resolve ( this . origin ) ;
63
- } ) ;
62
+ return Promise . resolve ( this . origin ) ;
64
63
}
65
64
66
65
this . started = true ;
67
66
this . running = true ;
68
67
69
68
if ( ! this . keepAlive && ( Platform . OS === 'android' ) ) {
70
- AppState . addEventListener ( 'change' , this . _handleAppStateChange . bind ( this ) ) ;
69
+ AppState . addEventListener ( 'change' , this . _handleAppStateChangeFn ) ;
71
70
}
72
71
73
72
return FPStaticServer . start ( this . port , this . root , this . localOnly , this . keepAlive )
@@ -87,7 +86,7 @@ class StaticServer {
87
86
this . stop ( ) ;
88
87
this . started = false ;
89
88
this . _origin = undefined ;
90
- AppState . removeEventListener ( 'change' , this . _handleAppStateChange . bind ( this ) ) ;
89
+ AppState . removeEventListener ( 'change' , this . _handleAppStateChangeFn ) ;
91
90
}
92
91
93
92
_handleAppStateChange ( appState ) {
You can’t perform that action at this time.
0 commit comments