Browse Source

sync @1800

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
pull/6227/head
Raju Udava 1 year ago
parent
commit
a64ff2e453
  1. 5
      packages/nc-gui/components/dlg/share-and-collaborate/SharePage.vue
  2. 8
      packages/nc-gui/composables/useGlobal/actions.ts
  3. 4
      packages/nc-gui/store/tables.ts

5
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

8
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]
})
}
}
}

4
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,
})
}

Loading…
Cancel
Save