mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-28 03:29:20 +03:00
Improved reviveFromJson() for *Model
This commit is contained in:
parent
f4b2fddf5e
commit
76c4f62186
18 changed files with 226 additions and 341 deletions
|
|
@ -10,12 +10,7 @@ export class EmailCollectionModel extends AbstractCollectionModel
|
|||
* @returns {EmailCollectionModel}
|
||||
*/
|
||||
static reviveFromJson(items) {
|
||||
let result = new EmailCollectionModel;
|
||||
Array.isArray(items) && items.forEach(email => {
|
||||
email = EmailModel.reviveFromJson(email);
|
||||
email && result.push(email);
|
||||
});
|
||||
return result;
|
||||
return super.reviveFromJson(items, email => EmailModel.reviveFromJson(email));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue