mirror of
https://github.com/umap-project/umap.git
synced 2025-04-29 11:52:38 +02:00
fix(sync): do not call getSyncMetadata
if it doesn't exist
This can arise when the form isn't bound to a "syncable" object. We might want to provide an utility to check an object is *syncable*, or a specific form to not attempt to sync objects which don't need it.
This commit is contained in:
parent
8e5c434988
commit
898a3e93b2
1 changed files with 4 additions and 2 deletions
|
@ -1186,8 +1186,10 @@ U.FormBuilder = L.FormBuilder.extend({
|
||||||
L.FormBuilder.prototype.setter.call(this, field, value)
|
L.FormBuilder.prototype.setter.call(this, field, value)
|
||||||
this.obj.isDirty = true
|
this.obj.isDirty = true
|
||||||
if ('render' in this.obj) this.obj.render([field], this)
|
if ('render' in this.obj) this.obj.render([field], this)
|
||||||
const { subject, metadata, engine } = this.obj.getSyncMetadata()
|
if ('getSyncMetadata' in this.obj) {
|
||||||
if (engine) engine.update(subject, metadata, field, value)
|
const { subject, metadata, engine } = this.obj.getSyncMetadata()
|
||||||
|
if (engine) engine.update(subject, metadata, field, value)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
finish: function () {
|
finish: function () {
|
||||||
|
|
Loading…
Reference in a new issue