{
return (basesUser.value.get(base.value?.id) || []).map((user: any) => {
@@ -199,10 +199,6 @@ function openTableCreateDialog(sourceIndex?: number | undefined, showSourceSelec
onCloseCallback: () => {
base.value.isExpanded = true
- if (forceShowBaseList.value) {
- forceShowBaseList.value = false
- }
-
if (!activeKey.value || !activeKey.value.includes(`collapse-${sourceId}`)) {
activeKey.value.push(`collapse-${sourceId}`)
}
@@ -245,7 +241,6 @@ const onProjectClick = async (base: NcProject, ignoreNavigation?: boolean, toggl
const cmdOrCtrl = isMac() ? metaKey.value : control.value
if (!cmdOrCtrl && activeProjectId.value === base.id) {
- forceShowBaseList.value = false
showProjectList.value = false
return
}
@@ -301,7 +296,6 @@ const onProjectClick = async (base: NcProject, ignoreNavigation?: boolean, toggl
updatedProject.isLoading = false
}
- forceShowBaseList.value = false
showProjectList.value = false
}
diff --git a/packages/nc-gui/pages/index.vue b/packages/nc-gui/pages/index.vue
index b6048cc6e3..367867f316 100644
--- a/packages/nc-gui/pages/index.vue
+++ b/packages/nc-gui/pages/index.vue
@@ -10,8 +10,6 @@ const { isSharedBase, isSharedErd } = storeToRefs(useBase())
const basesStore = useBases()
-const { forceShowBaseList } = storeToRefs(basesStore)
-
const { populateWorkspace } = useWorkspace()
const { signedIn } = useGlobal()
@@ -25,9 +23,6 @@ const route = router.currentRoute
const { basesList } = storeToRefs(basesStore)
const autoNavigateToProject = async () => {
- // If it is auto navigate to project that means we have to show base list sidebar instead of directly showing active base sidebar
- forceShowBaseList.value = true
-
const routeName = route.value.name as string
if (routeName !== 'index-typeOrId' && routeName !== 'index') {
return
diff --git a/packages/nc-gui/pages/signup/[[token]].vue b/packages/nc-gui/pages/signup/[[token]].vue
index d10374d1a6..c3e96e0a05 100644
--- a/packages/nc-gui/pages/signup/[[token]].vue
+++ b/packages/nc-gui/pages/signup/[[token]].vue
@@ -111,7 +111,6 @@ async function signUp() {
baseId: base.id,
tableId: table.id,
workspaceId: 'nc',
- resetForceShowBaseList: false,
})
}
} catch (e) {
diff --git a/packages/nc-gui/store/bases.ts b/packages/nc-gui/store/bases.ts
index bb91bb6845..a0756b7391 100644
--- a/packages/nc-gui/store/bases.ts
+++ b/packages/nc-gui/store/bases.ts
@@ -39,8 +39,6 @@ export const useBases = defineStore('basesStore', () => {
return route.value.params.baseId as string | undefined
})
- const forceShowBaseList = ref(false)
-
const showProjectList = ref(route.value.params.typeOrId === 'base' ? false : !route.value.params.baseId)
const baseHomeSearchQuery = ref('')
@@ -398,32 +396,8 @@ export const useBases = defineStore('basesStore', () => {
watch(
() => route.value.params.baseId,
- (newBaseId, oldBaseId) => {
+ () => {
baseHomeSearchQuery.value = ''
-
- if (newBaseId) {
- if (!forceShowBaseList.value) return
-
- /**
- * If oldBaseId is present that means we are navigation from one base to another base
- * In that case we have to set forceShowBaseList to false
- * */
- if (oldBaseId) {
- forceShowBaseList.value = false
- }
-
- return
- }
-
- /**
- * If base id is undefined that means are navigated to different page,
- * So in that case set forceShowBaseList to true so that on returning to bases we can show baseList sidebar
- * @note - Manually we have to set to false on click any base or on toggle from minisidebar
- * */
- forceShowBaseList.value = true
- },
- {
- immediate: true,
},
)
@@ -433,9 +407,11 @@ export const useBases = defineStore('basesStore', () => {
watch(
[() => route.value.params.baseId, () => route.value.params.viewId, () => route.value.params.viewTitle],
([newBaseId, newTableId, newViewId], [oldBaseId, oldTableId, oldViewId]) => {
- const shouldShowProjectList =
- forceShowBaseList.value ||
- !((newBaseId && newBaseId !== oldBaseId) || newTableId !== oldTableId || newViewId !== oldViewId)
+ const shouldShowProjectList = !(
+ (newBaseId && newBaseId !== oldBaseId) ||
+ newTableId !== oldTableId ||
+ newViewId !== oldViewId
+ )
if (showProjectList.value === shouldShowProjectList) return
@@ -443,19 +419,16 @@ export const useBases = defineStore('basesStore', () => {
},
)
- watch(
- () => route.value.params.baseId,
- (newBaseId) => {
- if (newBaseId) return
+ watch([() => basesList.value.length, () => isProjectsLoaded.value], ([baseListLength, newIsProjectsLoaded]) => {
+ /**
+ * Use case:
+ * If project list is empty and showProjectList is false,
+ * then we have to show project list else it will stuck in loading state (blank sidebar state)
+ */
+ if (baseListLength || !newIsProjectsLoaded || showProjectList.value) return
- /**
- * If base id is undefined that means are navigated to different page,
- * So in that case set forceShowBaseList to true so that on returning to bases we can show baseList sidebar
- * @note - Manually we have to set to false on click any base or on toggle from minisidebar
- * */
- forceShowBaseList.value = true
- },
- )
+ showProjectList.value = true
+ })
watch(activeProjectId, () => {
ncLastVisitedBase().set(activeProjectId.value)
@@ -495,7 +468,6 @@ export const useBases = defineStore('basesStore', () => {
basesUser,
clearBasesUser,
isDataSourceLimitReached,
- forceShowBaseList,
showProjectList,
baseHomeSearchQuery,
getBaseRoles,
diff --git a/packages/nc-gui/store/tables.ts b/packages/nc-gui/store/tables.ts
index bf6b3804af..29dc67ed43 100644
--- a/packages/nc-gui/store/tables.ts
+++ b/packages/nc-gui/store/tables.ts
@@ -15,7 +15,6 @@ export const useTablesStore = defineStore('tablesStore', () => {
const baseTables = ref