From 193c6126a979372cf15f958f7cb7ddd3118a35a0 Mon Sep 17 00:00:00 2001 From: Dorra Jaouad Date: Sat, 19 Jul 2025 15:49:26 +0200 Subject: [PATCH] fixup! fixup! fix: purge threads correctly --- .../RightSidebar/Threads/ThreadItem.vue | 25 ++++++++++++++++--- src/store/messagesStore.js | 8 +++--- src/stores/chatExtras.ts | 7 ++++-- 3 files changed, 30 insertions(+), 10 deletions(-) diff --git a/src/components/RightSidebar/Threads/ThreadItem.vue b/src/components/RightSidebar/Threads/ThreadItem.vue index a7de249a8..bac4c5637 100644 --- a/src/components/RightSidebar/Threads/ThreadItem.vue +++ b/src/components/RightSidebar/Threads/ThreadItem.vue @@ -17,6 +17,7 @@ import NcDateTime from '@nextcloud/vue/components/NcDateTime' import NcListItem from '@nextcloud/vue/components/NcListItem' import IconArrowLeftTop from 'vue-material-design-icons/ArrowLeftTop.vue' import IconBellOutline from 'vue-material-design-icons/BellOutline.vue' +import IconCommentAlertOutline from 'vue-material-design-icons/CommentAlertOutline.vue' import AvatarWrapper from '../../AvatarWrapper/AvatarWrapper.vue' import { getDisplayNameWithFallback } from '../../../utils/getDisplayName.ts' import { parseToSimpleMessage } from '../../../utils/textParse.ts' @@ -26,9 +27,19 @@ const { thread } = defineProps<{ thread: ThreadInfo }>() const router = useRouter() const route = useRoute() -const threadAuthor = computed(() => getDisplayNameWithFallback(thread.first.actorDisplayName, thread.first.actorType, true)) +const threadAuthor = computed(() => { + if (!thread.first) { + return + } + return getDisplayNameWithFallback(thread.first.actorDisplayName, thread.first.actorType, true) +}) const lastActivity = computed(() => thread.thread.lastActivity * 1000) -const name = computed(() => parseToSimpleMessage(thread.first.message, thread.first.messageParameters)) +const name = computed(() => { + if (!thread.first) { + return t('spreed', 'Thread origin message expired') + } + return parseToSimpleMessage(thread.first.message, thread.first.messageParameters) +}) const subname = computed(() => { if (!thread.last) { return t('spreed', 'No messages') @@ -72,14 +83,22 @@ const timeFormat = computed(() => { force-menu>