Skip to content

Commit

Permalink
fix: prevent view update (#1102)
Browse files Browse the repository at this point in the history
  • Loading branch information
cugu authored Sep 19, 2024
1 parent 6346140 commit ea03a3e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
Binary file modified ui/bun.lockb
Binary file not shown.
2 changes: 2 additions & 0 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
6 changes: 6 additions & 0 deletions ui/src/components/form/JSONSchemaFormFields.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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 }
Expand Down

0 comments on commit ea03a3e

Please sign in to comment.