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
diff options
context:
space:
mode:
authorTobias Speicher <rootcommander@gmail.com>2022-03-24 17:31:53 +0300
committerTobias Speicher <rootcommander@gmail.com>2022-03-24 23:53:23 +0300
commit68b340fe2319ca5519b9a6314e6c91f090c08fa1 (patch)
tree8cba9b0401101716d06c53cac2d06d96430808a9 /src/utils/signaling.js
parentae62e05fdde9e734ee03c8763190dd96fc3531bb (diff)
Replace deprecated String.prototype.substr()
.substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
Diffstat (limited to 'src/utils/signaling.js')
-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