File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 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 {
5858 this . selectedProtocol = PROTOCOL . HTTP ;
5959 this . socket = null ;
6060 this . pluginURL = null ;
61+ this . disabled = false ;
6162
6263 this . openChannel ( ( ) => this . socket . emit ( 'command' , 'list' ) ) ;
6364
@@ -92,6 +93,9 @@ export default class SocketDaemon extends Daemon {
9293 * First search in LOOPBACK_ADDRESS, after in LOOPBACK_HOST if in Chrome or Firefox, otherwise vice versa.
9394 */
9495 findAgent ( ) {
96+ if ( this . disabled ) {
97+ return ;
98+ }
9599 if ( this . pluginURL ) {
96100 fetch ( `${ this . pluginURL } /info` )
97101 . then ( response => response . json ( ) . then ( data => {
@@ -546,4 +550,13 @@ export default class SocketDaemon extends Daemon {
546550 } ) ;
547551 this . socket . emit ( 'command' , 'killupload' ) ;
548552 }
553+
554+ disable ( ) {
555+ this . disabled = true ;
556+ }
557+
558+ enable ( ) {
559+ this . disable = false ;
560+ this . findAgent ( ) ;
561+ }
549562}
You can’t perform that action at this time.
0 commit comments