diff options
author | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2021-03-05 14:22:05 +0300 |
---|---|---|
committer | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2021-03-05 14:46:48 +0300 |
commit | de1653461d953e288865baaa92de06f7cc1eb73d (patch) | |
tree | 01df5aad24d59a4c26fe86126b088ba00791c025 /src/utils | |
parent | b1a123d5d1d4c37087589b491a20df94203fd4c0 (diff) |
Show error notification also when signaling hello message fails
Until now an error notification was shown if the connection of the
websocket to the external signaling server failed. However, if the
websocket connection succeeded but then there was an error when actually
connecting to the signaling server at an application level (the hello
message response was an error) no error notification was shown in the
UI. Now the error notification is also shown in that case, and it will
not be removed (no matter if originally it happened due to an error in
the websocket or in the connection) until the connection has succeeded.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/signaling.js | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/utils/signaling.js b/src/utils/signaling.js index d65ea53d2..116df644f 100644 --- a/src/utils/signaling.js +++ b/src/utils/signaling.js @@ -581,10 +581,6 @@ Signaling.Standalone.prototype.connect = function() { this.signalingConnectionWarning.hideToast() this.signalingConnectionWarning = null } - if (this.signalingConnectionError !== null) { - this.signalingConnectionError.hideToast() - this.signalingConnectionError = null - } this.reconnectIntervalMs = this.initialReconnectIntervalMs this.sendHello() }.bind(this) @@ -849,12 +845,23 @@ Signaling.Standalone.prototype.helloResponseReceived = function(data) { return } + if (this.signalingConnectionError === null) { + this.signalingConnectionError = showError(t('spreed', 'Failed to establish signaling connection. Retrying …'), { + timeout: TOAST_PERMANENT_TIMEOUT, + }) + } + // TODO(fancycode): How should this be handled better? console.error('Could not connect to server', data) this.reconnect() return } + if (this.signalingConnectionError !== null) { + this.signalingConnectionError.hideToast() + this.signalingConnectionError = null + } + const resumedSession = !!this.resumeId this.connected = true if (this._forceReconnect && resumedSession) { |