From be1999e7f83ba72a07c9695ee09d6800f606c538 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Fri, 7 Feb 2025 08:54:25 +0530 Subject: [PATCH] fix: re-rendering of components when shifting from the unread list to the read list (#10835) Fixes https://github.com/chatwoot/chatwoot/issues/10812 Demo https://github.com/user-attachments/assets/a0f7eb64-8f6e-4992-a163-c972e85fb205 --------- Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Co-authored-by: Muhsin Keloth --- .../components-next/message/MessageList.vue | 40 ++++++------------- .../components-next/message/chips/Audio.vue | 5 ++- .../widgets/conversation/MessagesView.vue | 23 ++++++----- 3 files changed, 28 insertions(+), 40 deletions(-) diff --git a/app/javascript/dashboard/components-next/message/MessageList.vue b/app/javascript/dashboard/components-next/message/MessageList.vue index 505e5c03b..44b317c56 100644 --- a/app/javascript/dashboard/components-next/message/MessageList.vue +++ b/app/javascript/dashboard/components-next/message/MessageList.vue @@ -15,18 +15,14 @@ import { useCamelCase } from 'dashboard/composables/useTransformKeys'; * @property {Array} messages - Array of all messages [These are not in camelcase] */ const props = defineProps({ - readMessages: { - type: Array, - default: () => [], - }, - unReadMessages: { - type: Array, - default: () => [], - }, currentUserId: { type: Number, required: true, }, + firstUnreadId: { + type: Number, + default: null, + }, isAnEmailChannel: { type: Boolean, default: false, @@ -41,12 +37,8 @@ const props = defineProps({ }, }); -const unread = computed(() => { - return useCamelCase(props.unReadMessages, { deep: true }); -}); - -const read = computed(() => { - return useCamelCase(props.readMessages, { deep: true }); +const allMessages = computed(() => { + return useCamelCase(props.messages, { deep: true }); }); /** @@ -108,26 +100,18 @@ const getInReplyToMessage = parentMessage => {