diff --git a/frontend/src/components/content_value/ContentEntryEditor.vue b/frontend/src/components/content_value/ContentEntryEditor.vue index 00de864..08213a0 100644 --- a/frontend/src/components/content_value/ContentEntryEditor.vue +++ b/frontend/src/components/content_value/ContentEntryEditor.vue @@ -12,9 +12,10 @@ import WindowClose from '@/components/icons/WindowClose.vue' import Pin from '@/components/icons/Pin.vue' import OffScreen from '@/components/icons/OffScreen.vue' import ContentEditor from '@/components/content_value/ContentEditor.vue' -import { toString } from 'lodash' +import { isEmpty, toString } from 'lodash' const props = defineProps({ + keyPath: String, show: { type: Boolean, }, @@ -58,8 +59,8 @@ const emit = defineEmits([ watchEffect( () => { - if (props.show && props.value != null) { - onFormatChanged() + if (props.show && !isEmpty(props.keyPath)) { + onFormatChanged(props.decode, props.format) } else { viewAs.value = '' } @@ -127,6 +128,8 @@ const onFormatChanged = async (decode = null, format = null) => { editingContent.value = viewAs.value = value viewAs.decode = decode || retDecode viewAs.format = format || retFormat + emit('update:decode', viewAs.decode) + emit('update:format', viewAs.format) } finally { loading.value = false } diff --git a/frontend/src/components/content_value/ContentValueHash.vue b/frontend/src/components/content_value/ContentValueHash.vue index 32cd37e..ca9a864 100644 --- a/frontend/src/components/content_value/ContentValueHash.vue +++ b/frontend/src/components/content_value/ContentValueHash.vue @@ -1,5 +1,5 @@