Skip to content

Commit

Permalink
fix: resolve the issue of occasional blank metadata and error occurre…
Browse files Browse the repository at this point in the history
…nces
  • Loading branch information
LIlGG committed Oct 31, 2023
1 parent f2d7376 commit d658e70
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions console/src/components/form/AnnotationsForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import cloneDeep from "lodash.clonedeep";
import { getValidationMessages } from "@formkit/validation";
import { useThemeStore } from "@/stores/theme";
import { randomUUID } from "@/utils/id";
import { onUnmounted } from "vue";
const themeStore = useThemeStore();
Expand Down Expand Up @@ -150,9 +151,20 @@ onMounted(async () => {
handleProcessCustomAnnotations();
});
onUnmounted(() => {
cleanAnnotations();
annotationSettings.value = [];
});
const cleanAnnotations = () => {
annotations.value = {};
customAnnotationsState.value = [];
};
watch(
() => props.value,
(value) => {
cleanAnnotations();
reset(specFormId);
reset(customFormId);
annotations.value = cloneDeep(props.value) || {};
Expand Down

0 comments on commit d658e70

Please sign in to comment.