Skip to content

Commit

Permalink
fix: make useIsInCall a shared composable
Browse files Browse the repository at this point in the history
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
  • Loading branch information
Antreesy authored and backportbot[bot] committed Nov 8, 2024
1 parent 522b925 commit 8c3c438
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 8c3c438

Please sign in to comment.