fix: session user is not loading

This commit is contained in:
Shariq Ansari 2025-01-21 15:08:09 +05:30
parent cb2cb6db56
commit 8ec406dad0

View File

@ -253,7 +253,6 @@ import { ref, onBeforeUnmount, watch, nextTick } from 'vue'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
const { $socket } = globalStore() const { $socket } = globalStore()
const { user } = sessionStore()
const callPopupHeader = ref(null) const callPopupHeader = ref(null)
const showCallPopup = ref(false) const showCallPopup = ref(false)
@ -298,11 +297,14 @@ const getContact = createResource({
}, },
}) })
watch(phoneNumber, (value) => { watch(
if (!value) return phoneNumber,
getContact.fetch() (value) => {
}, { immediate: true }) if (!value) return
getContact.fetch()
},
{ immediate: true },
)
const dirty = ref(false) const dirty = ref(false)
@ -427,12 +429,13 @@ function setup() {
console.log(data) console.log(data)
callStatus.value = updateStatus(data) callStatus.value = updateStatus(data)
const { user } = sessionStore()
if ( if (
!showCallPopup.value && !showCallPopup.value &&
!showSmallCallPopup.value && !showSmallCallPopup.value &&
data.AgentEmail && data.AgentEmail &&
data.AgentEmail == user.value data.AgentEmail == (user || user.value)
) { ) {
phoneNumber.value = data.CallTo || data.To phoneNumber.value = data.CallTo || data.To
showCallPopup.value = true showCallPopup.value = true