From e41293de005d1d53706e07b297f6ceb37e39bae9 Mon Sep 17 00:00:00 2001 From: davelopez <46503462+davelopez@users.noreply.github.com> Date: Mon, 27 May 2024 18:46:18 +0200 Subject: [PATCH] Display archived message only to the owner --- .../History/CurrentHistory/HistoryMessages.vue | 11 ++++++++--- .../History/CurrentHistory/HistoryPanel.vue | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/client/src/components/History/CurrentHistory/HistoryMessages.vue b/client/src/components/History/CurrentHistory/HistoryMessages.vue index 3d97f80dd24a..ab5b6c1180cc 100644 --- a/client/src/components/History/CurrentHistory/HistoryMessages.vue +++ b/client/src/components/History/CurrentHistory/HistoryMessages.vue @@ -5,13 +5,14 @@ import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome"; import { BAlert } from "bootstrap-vue"; import { computed, ref } from "vue"; -import type { HistorySummary } from "@/api"; +import { type GenericUser, type HistorySummary, userOwnsHistory } from "@/api"; import localize from "@/utils/localization"; library.add(faArchive, faBurn, faTrash); interface Props { history: HistorySummary; + currentUser: GenericUser | null; } const props = defineProps(); @@ -21,10 +22,14 @@ const userOverQuota = ref(false); const hasMessages = computed(() => { return userOverQuota.value || props.history.deleted || props.history.archived; }); + +const currentUserOwnsHistory = computed(() => { + return userOwnsHistory(props.currentUser, props.history); +});