From 3f37d01aa34b630f531c834619dc4a52ae382cb0 Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 8 Nov 2024 13:15:33 +0100 Subject: [PATCH] FIX: interface state in case of null value --- .../interface.vue | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/auto-generate-file-transformations-interface/interface.vue b/src/auto-generate-file-transformations-interface/interface.vue index 11abab5..2ef2c63 100644 --- a/src/auto-generate-file-transformations-interface/interface.vue +++ b/src/auto-generate-file-transformations-interface/interface.vue @@ -5,8 +5,7 @@ import { useStores } from '@directus/extensions-sdk'; const props = defineProps({ value: { - type: Array as PropType, - default: [], + type: Array as PropType | null, }, }); @@ -33,6 +32,10 @@ const allTransformations = computed(() => { }); const displayAutoFormatNotice = computed(() => { + if (!props.value) { + return false; + } + return props.value.find((transformationKey) => { // check if transformation is a system transformation or if it's a custom transformation with format 'auto' const isSystemTransformation = systemTransformations.some((transformation) => transformation.value === transformationKey); @@ -61,7 +64,7 @@ const displayAutoFormatNotice = computed(() => { icon-off="check_box_outline_blank" :value="item.value" :label="item.text" - :model-value="value" + :model-value="value || []" @update:model-value="$emit('input', $event)" />