mirror of https://github.com/status-im/consul.git
ui: Don't look for isDescriptor on null (related to null proxies) (#5782)
This commit is contained in:
parent
fc14703a18
commit
a37d6aaac2
|
@ -7,18 +7,18 @@ const PREFIX = '_';
|
||||||
export default Mixin.create(WithListeners, {
|
export default Mixin.create(WithListeners, {
|
||||||
setProperties: function(model) {
|
setProperties: function(model) {
|
||||||
const _model = {};
|
const _model = {};
|
||||||
Object.keys(model).forEach(key => {
|
Object.keys(model).forEach(prop => {
|
||||||
// here (see comment below on deleting)
|
// here (see comment below on deleting)
|
||||||
if (typeof this[key] !== 'undefined' && this[key].isDescriptor) {
|
if (this[prop] && this[prop].isDescriptor) {
|
||||||
_model[`${PREFIX}${key}`] = model[key];
|
_model[`${PREFIX}${prop}`] = model[prop];
|
||||||
const meta = this.constructor.metaForProperty(key) || {};
|
const meta = this.constructor.metaForProperty(prop) || {};
|
||||||
if (typeof meta.catch === 'function') {
|
if (typeof meta.catch === 'function') {
|
||||||
if (typeof _model[`${PREFIX}${key}`].addEventListener === 'function') {
|
if (typeof _model[`${PREFIX}${prop}`].addEventListener === 'function') {
|
||||||
this.listen(_model[`_${key}`], 'error', meta.catch.bind(this));
|
this.listen(_model[`_${prop}`], 'error', meta.catch.bind(this));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
_model[key] = model[key];
|
_model[prop] = model[prop];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return this._super(_model);
|
return this._super(_model);
|
||||||
|
|
Loading…
Reference in New Issue