diff --git a/client/SignalExchangerClient.js b/client/SignalExchangerClient.js index dacc182..f27654e 100644 --- a/client/SignalExchangerClient.js +++ b/client/SignalExchangerClient.js @@ -138,6 +138,17 @@ class SignalExchangerClient { this.pending_signal_target = target_id; } + /** + * Stop to try to send the current signal message in queue + * + * This does not cancel the sending of messages already sent through + * socket + */ + cancelCurrentSignal() { + this.pending_signal = undefined; + this.pending_signal_target = undefined; + } + /** * Send data to the server * @@ -169,8 +180,7 @@ class SignalExchangerClient { else { //Else we can remove from this class information about the signal being sent - this.pending_signal = undefined; - this.pending_signal_target = undefined; + this.cancelCurrentSignal(); } }