Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorMarco <marcoambrosini@pm.me>2022-04-05 12:22:51 +0300
committerGitHub <noreply@github.com>2022-04-05 12:22:51 +0300
commit26d30d5b24aefbfbe5ada73e9592b4e0aa699544 (patch)
tree9d9c0de72ab78e1abcaf682fb6abd858086ea0e3 /src/utils
parent116036d509b8151e9c41cb784a78e52e1c4cd342 (diff)
parent68b340fe2319ca5519b9a6314e6c91f090c08fa1 (diff)
Merge pull request #7054 from CommanderRoot/refactor/rm-deprecated-substr
Replace deprecated String.prototype.substr()
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/signaling.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/utils/signaling.js b/src/utils/signaling.js
index a9231d88c..fab0e2a86 100644
--- a/src/utils/signaling.js
+++ b/src/utils/signaling.js
@@ -566,13 +566,13 @@ function Standalone(settings, urls) {
// TODO(jojo): Try other server if connection fails.
let url = urls[idx]
// Make sure we are using websocket urls.
- if (url.indexOf('https://') === 0) {
- url = 'wss://' + url.substr(8)
- } else if (url.indexOf('http://') === 0) {
- url = 'ws://' + url.substr(7)
+ if (url.startsWith('https://')) {
+ url = 'wss://' + url.slice(8)
+ } else if (url.startsWith('http://')) {
+ url = 'ws://' + url.slice(7)
}
- if (url[url.length - 1] === '/') {
- url = url.substr(0, url.length - 1)
+ if (url.endsWith('/')) {
+ url = url.slice(0, -1)
}
this.url = url + '/spreed'
this.initialReconnectIntervalMs = 1000