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' import { ActiveViewInj, FieldsInj, IsPublicInj, MetaInj, ReadonlyInj, ReloadViewDataHookInj } from '~/context'
const { sharedView, meta, sorts, nestedFilters } = useSharedView() const { sharedView, meta, sorts, nestedFilters } = useSharedView()
const { isAuthenticated } = useGlobal() const { signedIn } = useGlobal()
const { loadProject } = useProject(meta?.value.project_id) const { loadProject } = useProject(meta?.value.project_id)
const reloadEventHook = createEventHook<void>() const reloadEventHook = createEventHook<void>()
@ -19,7 +19,7 @@ provide(IsPublicInj, ref(true))
useProvideSmartsheetStore(sharedView as Ref<TableType>, meta, true, sorts, nestedFilters) useProvideSmartsheetStore(sharedView as Ref<TableType>, meta, true, sorts, nestedFilters)
if (isAuthenticated) { if (signedIn.value) {
try { try {
await loadProject() await loadProject()
} catch (e: any) { } 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 || '', get: () => storage.value.token || '',
set: (val) => (storage.value.token = val), set: (val) => (storage.value.token = val),
}) })
const isAuthenticated = !!token.value
const appInfo = ref<AppInfo>({ const appInfo = ref<AppInfo>({
ncSiteUrl: process.env.NC_BACKEND_URL || (process.env.NODE_ENV === 'production' ? location.origin : 'http://localhost:8080'), 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), ...toRefs(storage.value),
storage, storage,
token, token,
isAuthenticated,
jwtPayload: payload, jwtPayload: payload,
timestamp, timestamp,
runningRequests, runningRequests,

Loading…
Cancel
Save