mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-10 06:58:27 +03:00
Bugfix: revivePropertiesFromJson always set observables
This commit is contained in:
parent
65030bf8d8
commit
cc04e42444
2 changed files with 9 additions and 17 deletions
|
|
@ -20,8 +20,8 @@ export class AbstractCollectionModel extends Array
|
|||
* @returns {*CollectionModel}
|
||||
*/
|
||||
static reviveFromJson(json, itemCallback) {
|
||||
const result = new this();
|
||||
if (json) {
|
||||
const result = new this();
|
||||
if ('Collection/'+this.name.replace('Model', '') === json['@Object']) {
|
||||
Object.entries(json).forEach(([key, value]) => '@' !== key[0] && (result[key] = value));
|
||||
// json[@Count]
|
||||
|
|
@ -32,10 +32,9 @@ export class AbstractCollectionModel extends Array
|
|||
item && itemCallback && (item = itemCallback(item, result));
|
||||
item && result.push(item);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue