diff --git a/ui/bun.lockb b/ui/bun.lockb index 91c6e250..eb0bee68 100755 Binary files a/ui/bun.lockb and b/ui/bun.lockb differ diff --git a/ui/package.json b/ui/package.json index 22c39200..4447044a 100644 --- a/ui/package.json +++ b/ui/package.json @@ -28,6 +28,7 @@ "date-fns": "^3.6.0", "easymde": "^2.18.0", "lodash.debounce": "^4.0.8", + "lodash.isequal": "^4.5.0", "lucide-vue-next": "^0.365.0", "marked": "^12.0.2", "pinia": "^2.1.7", @@ -48,6 +49,7 @@ "@trivago/prettier-plugin-sort-imports": "^4.3.0", "@tsconfig/node20": "^20.1.2", "@types/lodash.debounce": "^4.0.9", + "@types/lodash.isequal": "^4.5.8", "@types/node": "^20.11.28", "@vitejs/plugin-vue": "^5.0.4", "@vue/eslint-config-prettier": "^8.0.0", diff --git a/ui/src/components/form/JSONSchemaFormFields.vue b/ui/src/components/form/JSONSchemaFormFields.vue index d909659d..fdb8c2b7 100644 --- a/ui/src/components/form/JSONSchemaFormFields.vue +++ b/ui/src/components/form/JSONSchemaFormFields.vue @@ -11,6 +11,7 @@ import { SelectValue } from '@/components/ui/select' +import isEqual from 'lodash.isequal' import { onMounted, ref, watch } from 'vue' import type { JSONSchema } from '@/lib/types' @@ -34,6 +35,11 @@ onMounted(() => { watch( () => formdata.value, () => { + const normFormdata = JSON.parse(JSON.stringify(formdata.value)) + const normModel = JSON.parse(JSON.stringify(model.value)) + + if (isEqual(normFormdata, normModel)) return + model.value = { ...formdata.value } }, { deep: true }