mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-01-05 06:22:52 +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(
|
Remote.folderInformation(
|
||||||
(iError, data) => {
|
(iError, data) => {
|
||||||
if (!iError && data.Result.Hash && data.Result.Folder) {
|
if (!iError && data.Result.Hash && data.Result.Folder) {
|
||||||
let uid = '',
|
let check = false,
|
||||||
check = false,
|
|
||||||
unreadCountChange = false;
|
unreadCountChange = false;
|
||||||
|
|
||||||
const folderFromCache = getFolderFromCacheList(data.Result.Folder);
|
const folderFromCache = getFolderFromCacheList(data.Result.Folder);
|
||||||
|
@ -566,19 +565,16 @@ class AppUser extends AbstractApp {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.Result.Flags) {
|
if (data.Result.Flags) {
|
||||||
for (uid in data.Result.Flags) {
|
Object.entries(data.Result.Flags).forEach(([uid,flags]) => {
|
||||||
if (Object.prototype.hasOwnProperty.call(data.Result.Flags, uid)) {
|
check = true;
|
||||||
check = true;
|
MessageFlagsCache.storeByFolderAndUid(folderFromCache.fullNameRaw, uid.toString(), [
|
||||||
const flags = data.Result.Flags[uid];
|
!!flags.IsUnseen,
|
||||||
MessageFlagsCache.storeByFolderAndUid(folderFromCache.fullNameRaw, uid.toString(), [
|
!!flags.IsFlagged,
|
||||||
!!flags.IsUnseen,
|
!!flags.IsAnswered,
|
||||||
!!flags.IsFlagged,
|
!!flags.IsForwarded,
|
||||||
!!flags.IsAnswered,
|
!!flags.IsReadReceipt
|
||||||
!!flags.IsForwarded,
|
]);
|
||||||
!!flags.IsReadReceipt
|
});
|
||||||
]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (check) {
|
if (check) {
|
||||||
this.reloadFlagsCurrentMessageListAndMessageFromCache();
|
this.reloadFlagsCurrentMessageListAndMessageFromCache();
|
||||||
|
|
Loading…
Reference in a new issue