[snappymail] Include subfolders in folder list rebuild

Subfolders also need to be taken into consideration, otherwise
subfolder deletion/creation won't be reflected in the UI.

Fixes #72
This commit is contained in:
David Härdeman 2021-08-25 00:12:46 +02:00
parent b658b79264
commit 0190170edd

View file

@ -68,12 +68,12 @@ export class FolderCollectionModel extends AbstractCollectionModel
return super.reviveFromJson(object, oFolder => { return super.reviveFromJson(object, oFolder => {
let oCacheFolder = Cache.getFolderFromCacheList(oFolder.FullNameRaw); let oCacheFolder = Cache.getFolderFromCacheList(oFolder.FullNameRaw);
/*
if (oCacheFolder) { if (oCacheFolder) {
oFolder.SubFolders = FolderCollectionModel.reviveFromJson(oFolder.SubFolders); oFolder.SubFolders = FolderCollectionModel.reviveFromJson(oFolder.SubFolders);
oFolder.SubFolders && oCacheFolder.subFolders(oFolder.SubFolders); oFolder.SubFolders && oCacheFolder.subFolders(oFolder.SubFolders);
} }
*/
if (!oCacheFolder && (oCacheFolder = FolderModel.reviveFromJson(oFolder))) { if (!oCacheFolder && (oCacheFolder = FolderModel.reviveFromJson(oFolder))) {
if (1 == SystemFolders.indexOf(oFolder.FullNameRaw)) { if (1 == SystemFolders.indexOf(oFolder.FullNameRaw)) {
oCacheFolder.type(FolderType.Inbox); oCacheFolder.type(FolderType.Inbox);