fix: TypeError - Cannot read properties of null (reading 'name') (#10887)

This commit is contained in:
Sivin Varghese
2025-02-12 12:31:54 +05:30
committed by GitHub
parent b3f616da76
commit cd80bd07ca
2 changed files with 7 additions and 2 deletions

View File

@@ -24,7 +24,7 @@ const { sender } = useMessageContext();
const { t } = useI18n();
const senderName = computed(() => {
return sender?.value.name;
return sender?.value?.name || '';
});
</script>

View File

@@ -9,7 +9,7 @@ import { useI18n } from 'vue-i18n';
import { useMessageContext } from '../provider.js';
import BaseAttachmentBubble from './BaseAttachment.vue';
const { contentAttributes } = useMessageContext();
const { content, sender, contentAttributes } = useMessageContext();
const { t } = useI18n();
@@ -53,6 +53,11 @@ const action = computed(() => ({
sender-translation-key="CONVERSATION.SHARED_ATTACHMENT.MEETING"
:action="action"
>
<div v-if="!sender" class="text-n-slate-12 text-sm truncate">
<!-- Added as a fallback, where the sender is not available (Deleted) -->
<!-- Will show the content, if senderName in BaseAttachment.vue is empty -->
{{ content }}
</div>
<div v-if="dyteAuthToken" class="video-call--container">
<iframe
:src="meetingLink"