Browse Source

fix(gui-v2): replace isAuthenticated with signedIn

pull/3374/head
Denis 2 years ago
parent
commit
a4e351807c
  1. 4
      packages/nc-gui-v2/components/shared-view/Grid.vue
  2. 2
      packages/nc-gui-v2/composables/useGlobal/state.ts

4
packages/nc-gui-v2/components/shared-view/Grid.vue

@ -6,7 +6,7 @@ import { message } from 'ant-design-vue'
import { ActiveViewInj, FieldsInj, IsPublicInj, MetaInj, ReadonlyInj, ReloadViewDataHookInj } from '~/context'
const { sharedView, meta, sorts, nestedFilters } = useSharedView()
const { isAuthenticated } = useGlobal()
const { signedIn } = useGlobal()
const { loadProject } = useProject(meta?.value.project_id)
const reloadEventHook = createEventHook<void>()
@ -19,7 +19,7 @@ provide(IsPublicInj, ref(true))
useProvideSmartsheetStore(sharedView as Ref<TableType>, meta, true, sorts, nestedFilters)
if (isAuthenticated) {
if (signedIn.value) {
try {
await loadProject()
} catch (e: any) {

2
packages/nc-gui-v2/composables/useGlobal/state.ts

@ -75,7 +75,6 @@ export function useGlobalState(storageKey = 'nocodb-gui-v2'): State {
get: () => storage.value.token || '',
set: (val) => (storage.value.token = val),
})
const isAuthenticated = !!token.value
const appInfo = ref<AppInfo>({
ncSiteUrl: process.env.NC_BACKEND_URL || (process.env.NODE_ENV === 'production' ? location.origin : 'http://localhost:8080'),
@ -106,7 +105,6 @@ export function useGlobalState(storageKey = 'nocodb-gui-v2'): State {
...toRefs(storage.value),
storage,
token,
isAuthenticated,
jwtPayload: payload,
timestamp,
runningRequests,

Loading…
Cancel
Save