mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
[snappymail] Rework FolderCollectionModel .js a bit
Following the previous bugfix, rework the .js code a bit to reduce the amount of nested ifdeffery.
This commit is contained in:
parent
0190170edd
commit
17f107057a
1 changed files with 21 additions and 21 deletions
|
|
@ -72,9 +72,11 @@ export class FolderCollectionModel extends AbstractCollectionModel
|
|||
if (oCacheFolder) {
|
||||
oFolder.SubFolders = FolderCollectionModel.reviveFromJson(oFolder.SubFolders);
|
||||
oFolder.SubFolders && oCacheFolder.subFolders(oFolder.SubFolders);
|
||||
}
|
||||
} else {
|
||||
oCacheFolder = FolderModel.reviveFromJson(oFolder);
|
||||
if (!oCacheFolder)
|
||||
return null;
|
||||
|
||||
if (!oCacheFolder && (oCacheFolder = FolderModel.reviveFromJson(oFolder))) {
|
||||
if (1 == SystemFolders.indexOf(oFolder.FullNameRaw)) {
|
||||
oCacheFolder.type(FolderType.Inbox);
|
||||
Cache.setFolderInboxName(oFolder.FullNameRaw);
|
||||
|
|
@ -82,7 +84,6 @@ export class FolderCollectionModel extends AbstractCollectionModel
|
|||
Cache.setFolder(oCacheFolder.fullNameHash, oFolder.FullNameRaw, oCacheFolder);
|
||||
}
|
||||
|
||||
if (oCacheFolder) {
|
||||
let type = SystemFolders.indexOf(oFolder.FullNameRaw);
|
||||
if (1 < type) {
|
||||
oCacheFolder.type(type);
|
||||
|
|
@ -105,7 +106,6 @@ export class FolderCollectionModel extends AbstractCollectionModel
|
|||
oCacheFolder.messageCountUnread(oFolder.Extended.MessageUnseenCount);
|
||||
}
|
||||
}
|
||||
}
|
||||
return oCacheFolder;
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue