Skip to content

Commit

Permalink
Merge pull request #13737 from nextcloud/fix/noid/use-is-in-call-shared
Browse files Browse the repository at this point in the history
  • Loading branch information
Antreesy authored Nov 8, 2024
2 parents 4b0f62f + 87df0d2 commit 8e5c7f9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/composables/useIsInCall.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

import { createSharedComposable } from '@vueuse/core'
import { computed, onBeforeMount, onBeforeUnmount, ref } from 'vue'

import { useStore } from './useStore.js'
Expand All @@ -16,7 +17,7 @@ import { useCallViewStore } from '../stores/callView.js'
*
* @return {import('vue').ComputedRef<boolean>}
*/
export function useIsInCall() {
function useIsInCallComposable() {
const store = useStore()
const callViewStore = useCallViewStore()

Expand All @@ -42,3 +43,9 @@ export function useIsInCall() {
return sessionStorageJoinedConversation.value === store.getters.getToken() && store.getters.isInCall(store.getters.getToken())
})
}

/**
* Shared composable to check whether the user joined the call of the current token in this PHP session or not
* @return {import('vue').ComputedRef<boolean>}
*/
export const useIsInCall = createSharedComposable(useIsInCallComposable)

0 comments on commit 8e5c7f9

Please sign in to comment.