From 25d71f9654e2192bc89a93e528baf52d0ccb4d07 Mon Sep 17 00:00:00 2001 From: braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Mon, 10 Oct 2022 11:28:03 +0200 Subject: [PATCH] fix(nc-gui): add fallback client type --- packages/nc-gui/composables/useProject.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/composables/useProject.ts b/packages/nc-gui/composables/useProject.ts index b0b46af67c..478aa51b17 100644 --- a/packages/nc-gui/composables/useProject.ts +++ b/packages/nc-gui/composables/useProject.ts @@ -2,6 +2,7 @@ import type { OracleUi, ProjectType, TableType } from 'nocodb-sdk' import { SqlUiFactory } from 'nocodb-sdk' import { isString } from '@vueuse/core' import { + ClientType, computed, createEventHook, ref, @@ -54,13 +55,13 @@ const [setup, use] = useInjectionState(() => { } }) - const projectBaseType = $computed(() => project.value?.bases?.[0]?.type || '') + const projectBaseType = $computed(() => project.value?.bases?.[0]?.type || ClientType.MYSQL) const sqlUi = computed( () => SqlUiFactory.create({ client: projectBaseType }) as Exclude, typeof OracleUi>, ) - const isMysql = computed(() => ['mysql', 'mysql2'].includes(projectBaseType)) + const isMysql = computed(() => ['mysql', ClientType.MYSQL].includes(projectBaseType)) const isMssql = computed(() => projectBaseType === 'mssql') const isPg = computed(() => projectBaseType === 'pg') const isSharedBase = computed(() => projectType === 'base')