diff --git a/dist/index.js b/dist/index.js index b342b985..da73f535 100644 --- a/dist/index.js +++ b/dist/index.js @@ -4919,17 +4919,6 @@ this.handleConnectionChange = () => { console.log("connection status:", this.isConnected, this.address); this.connectionChangeHandlerManager.trigger(); - if (this.isConnected == false) { - if (this.shouldAttemptReconnect == false) return; - this.reconnectInterval = setInterval(() => { - if (this.isConnected == true) { - clearInterval(this.reconnectInterval); - return; - } - this.reconnect(); - }, 5e3); - return; - } if (this.address == void 0) return; this.storeAddress(this.address); this.sendSubscriptionRequest(); @@ -4938,6 +4927,7 @@ }; // connection this.connect = (address) => { + console.log("connecting...", address); this.udn.connect(address); }; this.disconnect = () => { @@ -5099,6 +5089,11 @@ this.udn.onmailboxconnect = (mailboxId) => { console.log(`using mailbox ${mailboxId}`); }; + setInterval(() => { + if (this.isConnected == true) return; + if (this.shouldAttemptReconnect == false) return; + this.reconnect(); + }, 5e3); this.reconnect(); } // data @@ -5470,14 +5465,7 @@ "on:click": fileTransferViewModel2.showFileSelectionModal }, translations.general.backButton - ), /* @__PURE__ */ createElement( - "button", - { - disabled: true, - class: "flex" - }, - translations.general.waitingLabel - )))); + ), /* @__PURE__ */ createElement("button", { disabled: true, class: "flex" }, translations.general.waitingLabel)))); } function TransferDisplayModal(fileTransferViewModel2) { const isPresented = createProxyState( @@ -5612,7 +5600,7 @@ }; // handlers this.handleMessage = (data) => { - console.log(this.transferData); + if (this.transferData == void 0) return; if (data.messageChannel != this.transferData.channel) return; if (data.messageBody == _FileTransferModel.READY_MESSAGE && this.direction == 0 /* Send */) { console.log("TRIGGER"); diff --git a/src/Model/Global/connectionModel.ts b/src/Model/Global/connectionModel.ts index ad9a3623..5419e226 100644 --- a/src/Model/Global/connectionModel.ts +++ b/src/Model/Global/connectionModel.ts @@ -35,20 +35,6 @@ export default class ConnectionModel { handleConnectionChange = (): void => { console.log("connection status:", this.isConnected, this.address); this.connectionChangeHandlerManager.trigger(); - - if (this.isConnected == false) { - if (this.shouldAttemptReconnect == false) return; - - this.reconnectInterval = setInterval(() => { - if (this.isConnected == true) { - clearInterval(this.reconnectInterval); - return; - } - this.reconnect(); - }, 5000); - - return; - } if (this.address == undefined) return; this.storeAddress(this.address); @@ -59,6 +45,7 @@ export default class ConnectionModel { // connection connect = (address: string): void => { + console.log("connecting...", address); this.udn.connect(address); }; @@ -272,6 +259,11 @@ export default class ConnectionModel { console.log(`using mailbox ${mailboxId}`); }; + setInterval(() => { + if (this.isConnected == true) return; + if (this.shouldAttemptReconnect == false) return; + this.reconnect(); + }, 5000) this.reconnect(); } } diff --git a/src/Model/Global/fileTransferModel.ts b/src/Model/Global/fileTransferModel.ts index 35ed07b2..d1cc141a 100644 --- a/src/Model/Global/fileTransferModel.ts +++ b/src/Model/Global/fileTransferModel.ts @@ -53,7 +53,7 @@ export default class FileTransferModel { // handlers handleMessage = (data: Message): void => { - console.log(this.transferData); + if (this.transferData == undefined) return; if (data.messageChannel != this.transferData.channel) return; if ( data.messageBody == FileTransferModel.READY_MESSAGE &&