Skip to content

Commit

Permalink
Consolidate computed values in Activity Bar component
Browse files Browse the repository at this point in the history
  • Loading branch information
guerler committed Dec 10, 2024
1 parent 39e38c9 commit 6cf5917
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions client/src/components/ActivityBar/ActivityBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ const dragItem: Ref<Activity | null> = ref(null);
// drag state
const isDragging = ref(false);
// computed values
const canDrag = computed(() => isActiveSideBar("settings"));
const isSideBarOpen = computed(() => activityStore.toggledSideBar !== "");
/**
* Checks if the route of an activity is currently being visited and panels are collapsed
*/
Expand All @@ -112,8 +116,6 @@ function isActiveSideBar(menuKey: string) {
return activityStore.toggledSideBar === menuKey;
}
const isSideBarOpen = computed(() => activityStore.toggledSideBar !== "");
/**
* Checks if an activity that has a panel should have the `is-active` prop
*/
Expand Down Expand Up @@ -189,10 +191,6 @@ function setActiveSideBar(key: string) {
activityStore.toggledSideBar = key;
}
const canDrag = computed(() => {
return isActiveSideBar("settings");
});
defineExpose({
isActiveSideBar,
setActiveSideBar,
Expand Down

0 comments on commit 6cf5917

Please sign in to comment.