fix bug where manual disconnect would not be respected

This commit is contained in:
marlon-erler
2026-04-07 18:17:04 +00:00
parent bb0a71a01f
commit 1c74484644
+2 -2
View File
@@ -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 => {