@@ -276,7 +282,7 @@ import IconBackground from '../../../img/material-icons/replace-background.svg?r
import { useDevices } from '../../composables/useDevices.js'
import { useGetToken } from '../../composables/useGetToken.ts'
import { useIsInCall } from '../../composables/useIsInCall.js'
-import { ATTENDEE, AVATAR, CALL, CONFIG, PARTICIPANT, VIRTUAL_BACKGROUND } from '../../constants.ts'
+import { ATTENDEE, AVATAR, CALL, CONFIG, CONVERSATION, PARTICIPANT, VIRTUAL_BACKGROUND } from '../../constants.ts'
import BrowserStorage from '../../services/BrowserStorage.js'
import {
getTalkConfig,
@@ -438,6 +444,15 @@ export default {
return !this.userId && this.actorStore.actorType === ATTENDEE.ACTOR_TYPE.GUESTS
},
+ isVoiceRoom() {
+ return Boolean(this.conversation.attributes & CONVERSATION.ATTRIBUTE.VOICE_ROOM)
+ },
+
+ hideCloseButton() {
+ // Guests don't have Home dashboard so no rooting possible
+ return this.isGuest && this.isVoiceRoom && this.isBeforeJoinCall
+ },
+
userId() {
return this.actorStore.userId
},
@@ -519,7 +534,7 @@ export default {
showNotifyCallOption() {
return !this.hasCall && !this.isPublicShareAuthSidebar
- && this.isBeforeJoinCall
+ && this.isBeforeJoinCall && !this.isVoiceRoom
},
showStartRecordingOption() {
@@ -711,6 +726,13 @@ export default {
methods: {
t,
+ handleDialogClose() {
+ if (this.isBeforeJoinCall && this.isVoiceRoom && !this.isGuest) {
+ this.$router?.push({ name: 'root' })
+ }
+ this.close()
+ },
+
showMediaSettings(page) {
this.show = true
if (page === 'video-verification') {
diff --git a/src/stores/callView.ts b/src/stores/callView.ts
index cbaf0273c8e..c7564ab9f2d 100644
--- a/src/stores/callView.ts
+++ b/src/stores/callView.ts
@@ -75,6 +75,9 @@ export const useCallViewStore = defineStore('callView', {
if (!conversation) {
return
}
+ // Start every call with a clean selection, so a stale peer id
+ // from a previous call is not carried over
+ this.setSelectedVideoPeerId(null)
const gridPreference = BrowserStorage.getItem(`callprefs-${conversation.token}-isgrid`)
const isGrid = gridPreference === null
// not defined yet, default to grid view for group/public calls, otherwise speaker view
diff --git a/src/utils/sounds.js b/src/utils/sounds.js
index c4165f3a842..7911432bf99 100644
--- a/src/utils/sounds.js
+++ b/src/utils/sounds.js
@@ -3,10 +3,22 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
+import { CONVERSATION } from '../constants.ts'
+import store from '../store/index.js'
import pinia from '../stores/pinia.ts'
import { useSoundsStore } from '../stores/sounds.js'
+import { useTokenStore } from '../stores/token.ts'
const soundsStore = useSoundsStore(pinia)
+const tokenStore = useTokenStore(pinia)
+
+/**
+ * Checks if the current conversation is a voice room.
+ */
+function isVoiceRoom() {
+ const conversation = store.getters.conversation(tokenStore.token)
+ return Boolean(conversation?.attributes & CONVERSATION.ATTRIBUTE.VOICE_ROOM)
+}
export const Sounds = {
BLOCK_SOUND_TIMEOUT: 3000,
@@ -24,7 +36,7 @@ export const Sounds = {
},
async playWaiting() {
- if (!soundsStore.shouldPlaySounds) {
+ if (!soundsStore.shouldPlaySounds || isVoiceRoom()) {
return
}
diff --git a/src/views/MainView.vue b/src/views/MainView.vue
index 517bd068da0..44487feaf11 100644
--- a/src/views/MainView.vue
+++ b/src/views/MainView.vue
@@ -48,6 +48,17 @@ function stopWatchingJoinedConversation() {
const isInLobby = computed(() => store.getters.isInLobby)
const connectionFailed = computed(() => store.getters.connectionFailed(props.token))
+const isVoiceRoom = computed(() => Boolean(store.getters.conversation(props.token)?.attributes & CONVERSATION.ATTRIBUTE.VOICE_ROOM))
+
+watch([() => props.token, isVoiceRoom], ([newToken, newIsVoiceRoom]) => {
+ // Release a stale joined-conversation listener when navigating away
+ if (watchedJoinedConversationToken && watchedJoinedConversationToken !== newToken) {
+ stopWatchingJoinedConversation()
+ }
+ if (newIsVoiceRoom && newToken) {
+ handleDirectCall(newToken)
+ }
+}, { immediate: true })
watch(isInLobby, (isInLobby) => {
// User is now blocked by the lobby
@@ -59,12 +70,6 @@ watch(isInLobby, (isInLobby) => {
}
})
-watch(() => props.token, (newToken) => {
- if (watchedJoinedConversationToken && watchedJoinedConversationToken !== newToken) {
- stopWatchingJoinedConversation()
- }
-})
-
onMounted(() => {
watchEffect(() => {
if (route.hash === '#direct-call') {