From ddb15d0ce010d289a0e3b6ca31c5f15c7a2d55a5 Mon Sep 17 00:00:00 2001 From: Alvin Sebastian Date: Thu, 25 Jan 2024 05:34:29 +0000 Subject: [PATCH] Fix 116 always go to root after saving --- src/app/views/CrateoView.vue | 3 ++- src/lib/components/CrateEditor.vue | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/views/CrateoView.vue b/src/app/views/CrateoView.vue index d51ec63..7280702 100644 --- a/src/app/views/CrateoView.vue +++ b/src/app/views/CrateoView.vue @@ -135,6 +135,7 @@ const commands = { await writable.write(content); await writable.close(); data.crate = crate; + data.entityId = ''; data.validationResult = validate(data.crate, profile.value); data.validationResultDialog = !isEmpty(data.validationResult); } @@ -333,7 +334,7 @@ function updateCrate(raw, roc) { Mode:  - +

Load and add a new mode from your computer ...

diff --git a/src/lib/components/CrateEditor.vue b/src/lib/components/CrateEditor.vue index aa07b32..6f16cac 100644 --- a/src/lib/components/CrateEditor.vue +++ b/src/lib/components/CrateEditor.vue @@ -176,6 +176,9 @@ function updateEntity(entity, prop, value) { entity[prop] = value; emit('update:crate', props.crate); // ,state.crate, diff } + if (prop === '@id' && value !== props.entityId) { + emit('update:entityId', value); + } } else { data.entity = entity; emit('update:crate', props.crate); // ,state.crate, diff