Skip to content

Commit

Permalink
fix(AdminSettings): infinite loading on invalid turn test
Browse files Browse the repository at this point in the history
Signed-off-by: Grigorii K. Shartsev <[email protected]>
  • Loading branch information
ShGKme authored and Antreesy committed Jul 26, 2024
1 parent 6bc4c96 commit 4a85d2e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/components/AdminSettings/TurnServer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
<NcButton v-show="!loading"
type="tertiary"
:aria-label="testResult"
:disabled="!testAvailable"
@click="testServer">
<template #icon>
<span v-if="testing" class="icon icon-loading-small" />
Expand Down Expand Up @@ -196,6 +197,11 @@ export default {
}
return t('spreed', 'Test this server')
},
testAvailable() {
const schemes = this.schemes.split(',')
const protocols = this.protocols.split(',')
return !!(schemes.length && this.server && this.secret && protocols.length)
},
},
mounted() {
Expand All @@ -212,16 +218,17 @@ export default {
methods: {
t,
testServer() {
this.testing = true
this.testingError = false
this.testingSuccess = false
const schemes = this.schemes.split(',')
const protocols = this.protocols.split(',')
if (!schemes.length || !this.server || !this.secret || !protocols.length) {
if (!this.testAvailable) {
return
}
this.testing = true
const urls = []
for (let i = 0; i < schemes.length; i++) {
for (let j = 0; j < protocols.length; j++) {
Expand Down

0 comments on commit 4a85d2e

Please sign in to comment.