fix(nc-gui): error on clicking custom hue option

This commit is contained in:
Ramesh Mane
2024-03-12 06:44:56 +00:00
parent 79bc28c765
commit d68c20cf2e
3 changed files with 33 additions and 46 deletions

View File

@@ -235,7 +235,7 @@ async function addNewProjectChildEntity() {
isAddNewProjectChildEntityLoading.value = true
const isProjectPopulated = basesStore.isProjectPopulated(base.value.id!)
if (!isProjectPopulated && base.value.type === NcProjectType.DB) {
if (!isProjectPopulated && base.value?.type === NcProjectType.DB) {
// We do not wait for tables api, so that add new table is seamless.
// Only con would be while saving table duplicate table name FE validation might not work
// If the table list api takes time to load before the table name validation
@@ -245,7 +245,7 @@ async function addNewProjectChildEntity() {
try {
openTableCreateDialog()
if (!base.value.isExpanded && base.value.type !== NcProjectType.DB) {
if (!base.value.isExpanded && base.value?.type !== NcProjectType.DB) {
base.value.isExpanded = true
}
} finally {
@@ -432,11 +432,11 @@ watchEffect(() => {
:key="parseProp(base.meta).iconHue"
:hue="parseProp(base.meta).iconHue"
size="small"
:readonly="base.type && base.type !== 'database'"
:readonly="base?.type && base?.type !== 'database'"
@color-selected="setColor($event, base)"
>
<template #default>
<GeneralProjectIcon :type="base.type" />
<GeneralProjectIcon :type="base?.type" />
</template>
</LazyGeneralBaseColorPicker>
</div>
@@ -739,7 +739,7 @@ watchEffect(() => {
</div>
<template v-if="!isSharedBase" #overlay>
<NcMenu class="!py-0 rounded text-sm">
<template v-if="contextMenuTarget.type === 'base' && base.type === 'database'"></template>
<template v-if="contextMenuTarget.type === 'base' && base?.type === 'database'"></template>
<template v-else-if="contextMenuTarget.type === 'source'"></template>