From e64c2f64d9decef0714f06da875ca97906a8a8d3 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Mon, 23 Nov 2020 22:17:37 +0100 Subject: [PATCH 1/2] Reset SIP enabled checkbox in case of error Signed-off-by: Vincent Petry --- .../ConversationSettings/SipSettings.vue | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/components/ConversationSettings/SipSettings.vue b/src/components/ConversationSettings/SipSettings.vue index 0cfca4c6d3b..1c5c83a5950 100644 --- a/src/components/ConversationSettings/SipSettings.vue +++ b/src/components/ConversationSettings/SipSettings.vue @@ -25,13 +25,13 @@ {{ t('spreed', 'Allow participants to join from a phone.') }} + @change="toggleSipEnabled"> @@ -46,6 +46,7 @@ export default { data() { return { isSipLoading: false, + newSipEnabled: null, } }, @@ -58,13 +59,22 @@ export default { return this.$store.getters.conversation(this.token) || this.$store.getters.dummyConversation }, - hasSIPEnabled() { - return this.conversation.sipEnabled === WEBINAR.SIP.ENABLED + hasSipEnabled: { + get() { + if (this.newSipEnabled !== null) { + return this.newSipEnabled + } + return this.conversation.sipEnabled === WEBINAR.SIP.ENABLED + }, + set(value) { + this.newSipEnabled = value + }, }, }, methods: { - async toggleSIPEnabled() { + async toggleSipEnabled(checked) { + this.isSipLoading = true try { await this.$store.dispatch('setSIPEnabled', { token: this.token, @@ -76,6 +86,8 @@ export default { showSuccess(t('spreed', 'SIP dial-in is now disabled')) } } catch (e) { + // revert checkbox state + this.newSipEnabled = !checked // TODO check "precondition failed" if (!this.conversation.sipEnabled) { console.error('Error occurred when enabling SIP dial-in', e) @@ -85,6 +97,7 @@ export default { showError(t('spreed', 'Error occurred when disabling SIP dial-in')) } } + this.isSipLoading = false }, }, } From 06011879e6750aac3cbe8aa2bf1114b2974e3070 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Wed, 25 Nov 2020 17:11:58 +0100 Subject: [PATCH 2/2] Prevent locking conversation while in call Signed-off-by: Vincent Petry --- .../ConversationSettings/LockingSettings.vue | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/ConversationSettings/LockingSettings.vue b/src/components/ConversationSettings/LockingSettings.vue index 758c4a7e99c..8ea4456f38f 100644 --- a/src/components/ConversationSettings/LockingSettings.vue +++ b/src/components/ConversationSettings/LockingSettings.vue @@ -31,20 +31,28 @@ class="checkbox" name="moderation_settings_lock_conversation_checkbox" :checked="isReadOnly" - :disabled="isReadOnlyStateLoading" + :disabled="isReadOnlyStateLoading || isInCall" @change="toggleReadOnly"> + {{ t('spreed', 'You cannot lock a conversation while in a call!') }}