mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 20:19:22 +03:00
Object.entries().forEach() to forEachObjectEntry()
This commit is contained in:
parent
b8eb8f83fa
commit
6d7911a9ed
8 changed files with 18 additions and 18 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { isArray } from 'Common/Utils';
|
||||
import { isArray, forEachObjectEntry } from 'Common/Utils';
|
||||
|
||||
export class AbstractCollectionModel extends Array
|
||||
{
|
||||
|
|
@ -24,7 +24,7 @@ export class AbstractCollectionModel extends Array
|
|||
const result = new this();
|
||||
if (json) {
|
||||
if ('Collection/'+this.name.replace('Model', '') === json['@Object']) {
|
||||
Object.entries(json).forEach(([key, value]) => '@' !== key[0] && (result[key] = value));
|
||||
forEachObjectEntry(json, (key, value) => '@' !== key[0] && (result[key] = value));
|
||||
json = json['@Collection'];
|
||||
}
|
||||
if (isArray(json)) {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { MessagePriority } from 'Common/EnumsUser';
|
|||
import { i18n } from 'Common/Translator';
|
||||
|
||||
import { encodeHtml } from 'Common/Html';
|
||||
import { isArray, arrayLength } from 'Common/Utils';
|
||||
import { isArray, arrayLength, forEachObjectEntry } from 'Common/Utils';
|
||||
|
||||
import { serverRequestRaw } from 'Common/Links';
|
||||
|
||||
|
|
@ -275,7 +275,7 @@ export class MessageModel extends AbstractModel {
|
|||
*/
|
||||
lineAsCss() {
|
||||
let classes = [];
|
||||
Object.entries({
|
||||
forEachObjectEntry({
|
||||
deleted: this.deleted(),
|
||||
'deleted-mark': this.isDeleted(),
|
||||
selected: this.selected(),
|
||||
|
|
@ -291,7 +291,7 @@ export class MessageModel extends AbstractModel {
|
|||
// hasChildrenMessage: 1 < this.threadsLen(),
|
||||
hasUnseenSubMessage: this.hasUnseenSubMessage(),
|
||||
hasFlaggedSubMessage: this.hasFlaggedSubMessage()
|
||||
}).forEach(([key, value]) => value && classes.push(key));
|
||||
}, (key, value) => value && classes.push(key));
|
||||
return classes.join(' ');
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue