summaryrefslogtreecommitdiffstats
path: root/src/components/TopBar/CallButton.vue
diff options
context:
space:
mode:
authormarco <marcoambrosini@pm.me>2021-09-09 09:32:04 +0200
committermarco <marcoambrosini@pm.me>2021-10-05 18:16:33 +0200
commit26d0214166498fa6569105d0a1b24b5bece9b390 (patch)
treecac6765117b1d3043d493795a2b0a380a059c195 /src/components/TopBar/CallButton.vue
parent7d4e3c6877d697e3d0136fdfedd0462b709070bd (diff)
Create DeviceChecker component
Signed-off-by: marco <marcoambrosini@pm.me>
Diffstat (limited to 'src/components/TopBar/CallButton.vue')
-rw-r--r--src/components/TopBar/CallButton.vue26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/components/TopBar/CallButton.vue b/src/components/TopBar/CallButton.vue
index d0ffee55e..35e1ac75d 100644
--- a/src/components/TopBar/CallButton.vue
+++ b/src/components/TopBar/CallButton.vue
@@ -31,7 +31,7 @@
:disabled="startCallButtonDisabled || loading || blockCalls"
class="top-bar__button"
:class="startCallButtonClasses"
- @click="joinCall">
+ @click="handleClick">
<span
class="icon"
:class="startCallIcon" />
@@ -55,6 +55,7 @@ import isInCall from '../../mixins/isInCall'
import participant from '../../mixins/participant'
import Tooltip from '@nextcloud/vue/dist/Directives/Tooltip'
import { emit } from '@nextcloud/event-bus'
+import BrowserStorage from '../../services/BrowserStorage'
export default {
name: 'CallButton',
@@ -69,6 +70,17 @@ export default {
participant,
],
+ props: {
+ /**
+ * Skips the device checker dialog and joins or starts the call
+ * upon clicking the button
+ */
+ forceJoinCall: {
+ type: Boolean,
+ default: false,
+ },
+ },
+
data() {
return {
loading: false,
@@ -211,6 +223,18 @@ export default {
})
this.loading = false
},
+
+ handleClick() {
+ const shouldShowDeviceCheckerScreen = (BrowserStorage.getItem('showDeviceChecker' + this.token) === null
+ || BrowserStorage.getItem('showDeviceChecker' + this.token) === 'true') && !this.forceJoinCall
+ console.debug(shouldShowDeviceCheckerScreen)
+ if (shouldShowDeviceCheckerScreen) {
+ emit('talk:device-checker:show')
+ } else {
+ emit('talk:device-checker:hide')
+ this.joinCall()
+ }
+ },
},
}
</script>