mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-11-10 17:13:38 +08:00
FolderInformation Result.Flags use Object.entries()
This commit is contained in:
parent
1c95eab6d6
commit
8498290d93
1 changed files with 11 additions and 15 deletions
|
@ -537,8 +537,7 @@ class AppUser extends AbstractApp {
|
|||
Remote.folderInformation(
|
||||
(iError, data) => {
|
||||
if (!iError && data.Result.Hash && data.Result.Folder) {
|
||||
let uid = '',
|
||||
check = false,
|
||||
let check = false,
|
||||
unreadCountChange = false;
|
||||
|
||||
const folderFromCache = getFolderFromCacheList(data.Result.Folder);
|
||||
|
@ -566,19 +565,16 @@ class AppUser extends AbstractApp {
|
|||
}
|
||||
|
||||
if (data.Result.Flags) {
|
||||
for (uid in data.Result.Flags) {
|
||||
if (Object.prototype.hasOwnProperty.call(data.Result.Flags, uid)) {
|
||||
check = true;
|
||||
const flags = data.Result.Flags[uid];
|
||||
MessageFlagsCache.storeByFolderAndUid(folderFromCache.fullNameRaw, uid.toString(), [
|
||||
!!flags.IsUnseen,
|
||||
!!flags.IsFlagged,
|
||||
!!flags.IsAnswered,
|
||||
!!flags.IsForwarded,
|
||||
!!flags.IsReadReceipt
|
||||
]);
|
||||
}
|
||||
}
|
||||
Object.entries(data.Result.Flags).forEach(([uid,flags]) => {
|
||||
check = true;
|
||||
MessageFlagsCache.storeByFolderAndUid(folderFromCache.fullNameRaw, uid.toString(), [
|
||||
!!flags.IsUnseen,
|
||||
!!flags.IsFlagged,
|
||||
!!flags.IsAnswered,
|
||||
!!flags.IsForwarded,
|
||||
!!flags.IsReadReceipt
|
||||
]);
|
||||
});
|
||||
|
||||
if (check) {
|
||||
this.reloadFlagsCurrentMessageListAndMessageFromCache();
|
||||
|
|
Loading…
Reference in a new issue