File tree 1 file changed +13
-0
lines changed
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ export default class SocketDaemon extends Daemon {
58
58
this . selectedProtocol = PROTOCOL . HTTP ;
59
59
this . socket = null ;
60
60
this . pluginURL = null ;
61
+ this . disabled = false ;
61
62
62
63
this . openChannel ( ( ) => this . socket . emit ( 'command' , 'list' ) ) ;
63
64
@@ -92,6 +93,9 @@ export default class SocketDaemon extends Daemon {
92
93
* First search in LOOPBACK_ADDRESS, after in LOOPBACK_HOST if in Chrome or Firefox, otherwise vice versa.
93
94
*/
94
95
findAgent ( ) {
96
+ if ( this . disabled ) {
97
+ return ;
98
+ }
95
99
if ( this . pluginURL ) {
96
100
fetch ( `${ this . pluginURL } /info` )
97
101
. then ( response => response . json ( ) . then ( data => {
@@ -546,4 +550,13 @@ export default class SocketDaemon extends Daemon {
546
550
} ) ;
547
551
this . socket . emit ( 'command' , 'killupload' ) ;
548
552
}
553
+
554
+ disable ( ) {
555
+ this . disabled = true ;
556
+ }
557
+
558
+ enable ( ) {
559
+ this . disable = false ;
560
+ this . findAgent ( ) ;
561
+ }
549
562
}
You can’t perform that action at this time.
0 commit comments