Skip to content

Commit 0013208

Browse files
author
Stefania
committed
minor fix channelOpen status
1 parent 6bef9a7 commit 0013208

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/socket-daemon.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,11 @@ export default class SocketDaemon extends Daemon {
150150
}
151151
this.error.next('plugin version incompatible');
152152
}
153+
154+
// Set channelOpen false for the first time
155+
if (this.channelOpen.getValue() === null) {
156+
this.channelOpen.next(false);
157+
}
153158
return Promise.reject(new Error(`${CANT_FIND_AGENT_MESSAGE} at ${hostname}`));
154159
});
155160
}
@@ -234,11 +239,11 @@ export default class SocketDaemon extends Daemon {
234239
'Content-Type': 'text/plain; charset=utf-8'
235240
}
236241
}).then(() => Promise.reject()) // We reject the promise because the daemon will be restarted, we need to continue looking for the port
237-
.catch(err => {
238-
if (err.data && err.data.error && (err.data.error.indexOf('proxy') !== -1 || err.data.error.indexOf('dial tcp') !== -1)) {
239-
this.error.next('proxy error');
240-
}
241-
})
242+
.catch(err => {
243+
if (err.data && err.data.error && (err.data.error.indexOf('proxy') !== -1 || err.data.error.indexOf('dial tcp') !== -1)) {
244+
this.error.next('proxy error');
245+
}
246+
});
242247
}
243248

244249
/**

0 commit comments

Comments
 (0)