fix bug where manual disconnect would not be respected
This commit is contained in:
@@ -40,16 +40,17 @@ export default class ConnectionModel {
|
|||||||
this.storeAddress(this.address);
|
this.storeAddress(this.address);
|
||||||
this.sendSubscriptionRequest();
|
this.sendSubscriptionRequest();
|
||||||
this.sendMessagesInOutbox();
|
this.sendMessagesInOutbox();
|
||||||
this.shouldAttemptReconnect = true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// connection
|
// connection
|
||||||
connect = (address: string): void => {
|
connect = (address: string): void => {
|
||||||
console.log("connecting...", address);
|
console.log("connecting...", address);
|
||||||
|
this.shouldAttemptReconnect = true;
|
||||||
this.udn.connect(address);
|
this.udn.connect(address);
|
||||||
};
|
};
|
||||||
|
|
||||||
disconnect = (): void => {
|
disconnect = (): void => {
|
||||||
|
this.shouldAttemptReconnect = false;
|
||||||
this.udn.disconnect();
|
this.udn.disconnect();
|
||||||
|
|
||||||
// do not reconnect
|
// do not reconnect
|
||||||
@@ -58,7 +59,6 @@ export default class ConnectionModel {
|
|||||||
filePaths.connectionModel.reconnectAddress,
|
filePaths.connectionModel.reconnectAddress,
|
||||||
);
|
);
|
||||||
this.storageModel.remove(reconnectAddressPath);
|
this.storageModel.remove(reconnectAddressPath);
|
||||||
this.shouldAttemptReconnect = false;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
reconnect = (): void => {
|
reconnect = (): void => {
|
||||||
|
|||||||
Reference in New Issue
Block a user