From c0db972be8f00bd94e7357e352a81ebf7814a644 Mon Sep 17 00:00:00 2001 From: Ahmed Awan Date: Wed, 17 Jan 2024 00:29:48 +0500 Subject: [PATCH] `onMounted` toggle multiview sidebar when routing to multiview This only helps if the user routes from elsewhere and not by clicking on the multiview activity. If not for this, the user could miss out on using the sidepanel for multiview since the activity bar will persist with the previous toggled sidebar. --- .../components/History/Multiple/MultipleView.vue | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/client/src/components/History/Multiple/MultipleView.vue b/client/src/components/History/Multiple/MultipleView.vue index 8ac7cabafe5c..9d2e89331390 100644 --- a/client/src/components/History/Multiple/MultipleView.vue +++ b/client/src/components/History/Multiple/MultipleView.vue @@ -3,7 +3,7 @@ import { library } from "@fortawesome/fontawesome-svg-core"; import { faCheckSquare, faClock, faTimes, faUndo } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome"; import { storeToRefs } from "pinia"; -import { computed, ref, watch } from "vue"; +import { computed, onMounted, ref, watch } from "vue"; import { HistoryFilters } from "@/components/History/HistoryFilters"; import { Toast } from "@/composables/toast"; @@ -26,10 +26,17 @@ const initialLoaded = ref(false); library.add(faCheckSquare, faClock, faTimes, faUndo); -const { currentUser } = storeToRefs(useUserStore()); -const { histories, currentHistory, historiesLoading } = storeToRefs(useHistoryStore()); +const userStore = useUserStore(); +const { currentUser, toggledSideBar } = storeToRefs(userStore); + +onMounted(() => { + if (toggledSideBar.value !== "multiview") { + userStore.toggleSideBar("multiview"); + } +}); const historyStore = useHistoryStore(); +const { histories, currentHistory, historiesLoading } = storeToRefs(historyStore); const selectedHistories = computed(() => { if (hasPinnedHistories.value) {