Skip to content

πŸ”₯ πŸ”₯ πŸ”₯ A Free & Self-hostable Airtable Alternative

fix: in mobile view on click base it auto navigate to members page

Ramesh Manef62540bd296f
diff --git a/packages/nc-gui/components/dashboard/View.vue b/packages/nc-gui/components/dashboard/View.vue
index 56dc5726c2..3654cadec9 100644
--- a/packages/nc-gui/components/dashboard/View.vue
+++ b/packages/nc-gui/components/dashboard/View.vue
@@ -9,8 +9,6 @@ const { setLeftSidebarSize } = useGlobal()
const configStore = useConfigStore()
-const { handleSidebarOpenOnMobileForNonViews } = configStore
-
const { isMobileMode } = storeToRefs(configStore)
const slots = useSlots()
@@ -179,10 +177,6 @@ watch(sidebarState, () => {
}
})
-onMounted(() => {
- handleSidebarOpenOnMobileForNonViews()
-})
-
function onResize(widthPercent: any) {
if (isMobileMode.value) return
diff --git a/packages/nc-gui/components/tabs/Smartsheet.vue b/packages/nc-gui/components/tabs/Smartsheet.vue
index c181deddae..ab42bd9976 100644
--- a/packages/nc-gui/components/tabs/Smartsheet.vue
+++ b/packages/nc-gui/components/tabs/Smartsheet.vue
@@ -22,9 +22,6 @@ const { ncNavigateTo } = useGlobal()
const route = useRoute()
-const { handleSidebarOpenOnMobileForNonViews } = useConfigStore()
-const { activeTableId } = storeToRefs(useTablesStore())
-
const { activeProjectId } = storeToRefs(useBases())
const { activeWorkspaceId } = storeToRefs(useWorkspace())
@@ -184,10 +181,6 @@ const onDrop = async (event: DragEvent) => {
}
}
-watch([activeViewTitleOrId, activeTableId], () => {
- handleSidebarOpenOnMobileForNonViews()
-})
-
const { leftSidebarWidth, windowSize, isFullScreen } = storeToRefs(useSidebarStore())
const { isPanelExpanded, extensionPanelSize } = useExtensions()
diff --git a/packages/nc-gui/store/config.ts b/packages/nc-gui/store/config.ts
index 6834d8af9b..5b1732548f 100644
--- a/packages/nc-gui/store/config.ts
+++ b/packages/nc-gui/store/config.ts
@@ -7,12 +7,6 @@ export const useConfigStore = defineStore('configStore', () => {
const { isMobileMode: globalIsMobile } = useGlobal()
const { width } = useWindowSize()
- const sidebarStore = useSidebarStore()
- const viewsStore = useViewsStore()
- const { activeViewTitleOrId } = storeToRefs(viewsStore)
- const tablesStore = useTablesStore()
- const { activeTableId } = storeToRefs(tablesStore)
-
const isViewPortMobile = () => width.value < MAX_WIDTH_FOR_MOBILE_MODE
// When set to true expanded form will auto focus on comment input and state will be set to false after focussing
@@ -53,26 +47,9 @@ export const useConfigStore = defineStore('configStore', () => {
},
)
- const handleSidebarOpenOnMobileForNonViews = () => {
- if (!isViewPortMobile()) return
-
- if (!activeViewTitleOrId && !activeTableId) {
- nextTick(() => {
- sidebarStore.isLeftSidebarOpen = true
- })
- } else {
- sidebarStore.isLeftSidebarOpen = false
- }
- }
-
- watch([activeViewTitleOrId, activeTableId], () => {
- handleSidebarOpenOnMobileForNonViews()
- })
-
return {
isMobileMode,
isViewPortMobile,
- handleSidebarOpenOnMobileForNonViews,
projectPageTab,
isExpandedFormCommentMode,
hideSharedBaseBtn,
diff --git a/packages/nc-gui/store/sidebar.ts b/packages/nc-gui/store/sidebar.ts
index 810393fbd3..cd218275c2 100644
--- a/packages/nc-gui/store/sidebar.ts
+++ b/packages/nc-gui/store/sidebar.ts
@@ -20,6 +20,9 @@ export const useSidebarStore = defineStore('sidebarStore', () => {
const tablesStore = useTablesStore()
+ const viewsStore = useViewsStore()
+ const { activeViewTitleOrId } = storeToRefs(viewsStore)
+
const allowHideLeftSidebarForCurrentRoute = computed(() => {
return ['index-typeOrId-baseId-index-index', 'index-typeOrId-settings'].includes(route.name as string)
})
@@ -30,7 +33,7 @@ export const useSidebarStore = defineStore('sidebarStore', () => {
return _isLeftSidebarOpen.value
}
- return (isMobileMode.value && !tablesStore.activeTableId) || _isLeftSidebarOpen.value
+ return (isMobileMode.value && !activeViewTitleOrId.value) || _isLeftSidebarOpen.value
},
set(value) {
_isLeftSidebarOpen.value = value