Skip to content

Commit

Permalink
onMounted toggle multiview sidebar when routing to multiview
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ahmedhamidawan committed Jan 16, 2024
1 parent 57163a5 commit c0db972
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions client/src/components/History/Multiple/MultipleView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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<PinnedHistory[]>(() => {
if (hasPinnedHistories.value) {
Expand Down

0 comments on commit c0db972

Please sign in to comment.