From 8c3c4386690207e08a7da59f7f773960eec738bf Mon Sep 17 00:00:00 2001 From: Maksim Sukharev Date: Fri, 8 Nov 2024 14:37:58 +0100 Subject: [PATCH] fix: make useIsInCall a shared composable Signed-off-by: Maksim Sukharev --- src/composables/useIsInCall.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/composables/useIsInCall.js b/src/composables/useIsInCall.js index ef093c73ac5..774d2e5c6e6 100644 --- a/src/composables/useIsInCall.js +++ b/src/composables/useIsInCall.js @@ -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' @@ -16,7 +17,7 @@ import { useCallViewStore } from '../stores/callView.js' * * @return {import('vue').ComputedRef} */ -export function useIsInCall() { +function useIsInCallComposable() { const store = useStore() const callViewStore = useCallViewStore() @@ -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} + */ +export const useIsInCall = createSharedComposable(useIsInCallComposable)