diff --git a/packages/nc-gui-v2/composables/useProject.ts b/packages/nc-gui-v2/composables/useProject.ts index 98657f9772..05206a32e7 100644 --- a/packages/nc-gui-v2/composables/useProject.ts +++ b/packages/nc-gui-v2/composables/useProject.ts @@ -91,16 +91,20 @@ const [setup, use] = useInjectionState((_projectId?: MaybeRef) => { if (projectType === 'base') { return } - await $api.project.update(projectId.value, data) + if (data.meta && typeof data.meta === 'string') { + await $api.project.update(projectId.value, data) + } else { + await $api.project.update(projectId.value, { ...data, meta: JSON.stringify(data.meta) }) + } } async function saveTheme(theme: Partial) { await updateProject({ color: theme.primaryColor, - meta: JSON.stringify({ + meta: { ...projectMeta.value, theme, - }), + }, }) setTheme(theme) } diff --git a/packages/nc-gui-v2/pages/[projectType]/[projectId]/index.vue b/packages/nc-gui-v2/pages/[projectType]/[projectId]/index.vue index bec342b083..249763af32 100644 --- a/packages/nc-gui-v2/pages/[projectType]/[projectId]/index.vue +++ b/packages/nc-gui-v2/pages/[projectType]/[projectId]/index.vue @@ -89,19 +89,19 @@ const themeAccentColor = ref(theme.value.accentColor) // Chrome provides object so if custom picker used we only edit primary otherwise use analogous as accent watch(themePrimaryColor, (nextColor) => { - const hexColor = nextColor.hex ? nextColor.hex : nextColor + const hexColor = nextColor.hex8 ? nextColor.hex8 : nextColor const tcolor = tinycolor(hexColor) if (tcolor) { const analogous = tcolor.complement() saveTheme({ primaryColor: hexColor, - accentColor: nextColor.hex ? theme.value.accentColor : analogous.toHexString(), + accentColor: nextColor.hex8 ? theme.value.accentColor : analogous.toHexString(), }) } }) watch(themeAccentColor, (nextColor) => { - const hexColor = nextColor.hex ? nextColor.hex : nextColor + const hexColor = nextColor.hex8 ? nextColor.hex8 : nextColor saveTheme({ primaryColor: theme.value.primaryColor, accentColor: hexColor, diff --git a/packages/nc-gui-v2/pages/index/index/index.vue b/packages/nc-gui-v2/pages/index/index/index.vue index e505ac87c9..fd28edb2ce 100644 --- a/packages/nc-gui-v2/pages/index/index/index.vue +++ b/packages/nc-gui-v2/pages/index/index/index.vue @@ -1,6 +1,8 @@