diff --git a/client/src/components/History/HistoryScrollList.vue b/client/src/components/History/HistoryScrollList.vue index f124761ddb0e..35f1ec23e268 100644 --- a/client/src/components/History/HistoryScrollList.vue +++ b/client/src/components/History/HistoryScrollList.vue @@ -26,7 +26,6 @@ type PinnedHistory = { id: string }; const props = defineProps({ multiple: { type: Boolean, default: false }, - histories: { type: Array as PropType, default: () => [] }, selectedHistories: { type: Array as PropType, default: () => [] }, additionalOptions: { type: Array as PropType, default: () => [] }, showModal: { type: Boolean, default: false }, @@ -49,7 +48,7 @@ const showAdvanced = ref(false); const scrollableDiv: Ref = ref(null); const historyStore = useHistoryStore(); -const { currentHistoryId, totalHistoryCount, pinnedHistories } = storeToRefs(useHistoryStore()); +const { currentHistoryId, histories, totalHistoryCount, pinnedHistories } = storeToRefs(historyStore); const { currentUser } = storeToRefs(useUserStore()); const hasNoResults = computed(() => props.filter && filtered.value.length == 0); @@ -85,13 +84,10 @@ watch( } ); -// reactive proxy for props.histories, as the prop is not -// always guaranteed to be reactive for some strange reason. -// TODO: Re investigate when upgrading to vue3 /** `historyStore` histories for current user */ const historiesProxy: Ref = ref([]); watch( - () => props.histories as HistoryDetailed[], + () => histories.value as HistoryDetailed[], (h: HistoryDetailed[]) => { historiesProxy.value = h.filter( (h) => !h.user_id || (!currentUser.value?.isAnonymous && h.user_id === currentUser.value?.id) diff --git a/client/src/components/History/Modals/SelectorModal.vue b/client/src/components/History/Modals/SelectorModal.vue index d3987d407a15..6feb1c535f7b 100644 --- a/client/src/components/History/Modals/SelectorModal.vue +++ b/client/src/components/History/Modals/SelectorModal.vue @@ -124,7 +124,6 @@ function setFilterValue(newFilter: string, newValue: string) { useUserStore().isAnonymous); const historyStore = useHistoryStore(); -const { histories, historiesLoading, currentHistoryId } = storeToRefs(historyStore); +const { historiesLoading, currentHistoryId } = storeToRefs(historyStore); const pinnedHistoryCount = computed(() => { return Object.keys(historyStore.pinnedHistories).length; @@ -155,12 +155,6 @@ function userTitle(title: string) { Please log in or register to create multiple histories. - + diff --git a/client/src/stores/historyStore.ts b/client/src/stores/historyStore.ts index 379eec2b1be6..fa82ee602e1b 100644 --- a/client/src/stores/historyStore.ts +++ b/client/src/stores/historyStore.ts @@ -180,6 +180,7 @@ export const useHistoryStore = defineStore("historyStore", () => { await createNewHistory(); } Vue.delete(storedHistories.value, deletedHistory.id); + unpinHistories([deletedHistory.id]); await handleTotalCountChange(1, true); }