From a64ff2e4535367b2bedbafd3cb0c8a60ef2f3e12 Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Thu, 24 Aug 2023 17:55:45 +0530 Subject: [PATCH] sync @1800 Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> --- .../components/dlg/share-and-collaborate/SharePage.vue | 5 ++++- packages/nc-gui/composables/useGlobal/actions.ts | 8 ++++++++ packages/nc-gui/store/tables.ts | 4 ++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/packages/nc-gui/components/dlg/share-and-collaborate/SharePage.vue b/packages/nc-gui/components/dlg/share-and-collaborate/SharePage.vue index 236d738b40..e288297d49 100644 --- a/packages/nc-gui/components/dlg/share-and-collaborate/SharePage.vue +++ b/packages/nc-gui/components/dlg/share-and-collaborate/SharePage.vue @@ -45,8 +45,10 @@ const url = computed(() => { return sharedViewUrl() ?? '' }) +const passwordProtectedLocal = ref(false) + const passwordProtected = computed(() => { - return !!(activeView.value?.password !== undefined && activeView.value?.password !== null) + return !!activeView.value?.password || passwordProtectedLocal.value }) const password = computed({ @@ -74,6 +76,7 @@ const viewTheme = computed({ }) const togglePasswordProtected = async () => { + passwordProtectedLocal.value = !passwordProtected.value if (!activeView.value) return if (isUpdating.value.password) return diff --git a/packages/nc-gui/composables/useGlobal/actions.ts b/packages/nc-gui/composables/useGlobal/actions.ts index 8e28c42bb4..e581910d57 100644 --- a/packages/nc-gui/composables/useGlobal/actions.ts +++ b/packages/nc-gui/composables/useGlobal/actions.ts @@ -1,3 +1,4 @@ +import { getActivePinia } from 'pinia' import type { Actions, AppInfo, State } from './types' import { type NcProjectType, message, useNuxtApp } from '#imports' import { navigateTo } from '#app' @@ -16,6 +17,13 @@ export function useGlobalActions(state: State): Actions { } finally { state.token.value = null state.user.value = null + const pn = getActivePinia() + if (pn) { + pn._s.forEach((store) => { + store.$dispose() + delete pn.state.value[store.$id] + }) + } } } diff --git a/packages/nc-gui/store/tables.ts b/packages/nc-gui/store/tables.ts index e5a2125795..bddaefc7bf 100644 --- a/packages/nc-gui/store/tables.ts +++ b/packages/nc-gui/store/tables.ts @@ -129,7 +129,7 @@ export const useTablesStore = defineStore('tablesStore', () => { await getMeta(table.id as string) - const typeOrId = (route.value.params.typeOrId as string) || 'nc' + // const typeOrId = (route.value.params.typeOrId as string) || 'nc' let workspaceIdOrType = workspaceId @@ -144,7 +144,7 @@ export const useTablesStore = defineStore('tablesStore', () => { } await navigateTo({ - path: `/${workspaceIdOrType}/${projectIdOrBaseId}/table/${table?.id}${table.title ? `/${table.title}` : ''}`, + path: `/${workspaceIdOrType}/${projectIdOrBaseId}/table/${table?.id}`, query: route.value.query, }) }