Improved FolderCollection handling

This commit is contained in:
the-djmaze 2023-03-03 15:50:27 +01:00
parent a61ef0fa1c
commit 33c10365f0
10 changed files with 79 additions and 97 deletions

View file

@ -227,8 +227,6 @@ export class FolderCollectionModel extends AbstractCollectionModel
name: name,
fullName: parentName,
delimiter: delimiter,
exists: false,
isSubscribed: false,
flags: ['\\nonexistent']
});
setFolder(pfolder);
@ -380,6 +378,8 @@ export class FolderModel extends AbstractModel {
isFlagged: () => FolderUserStore.currentFolder() === this
&& MessagelistUserStore.listSearch().includes('flagged'),
// isSubscribed: () => this.flags().includes('\\subscribed'),
hasVisibleSubfolders: () => !!this.subFolders().find(folder => folder.visible()),
hasSubscriptions: () => this.isSubscribed() | !!this.subFolders().find(
@ -535,6 +535,10 @@ export class FolderModel extends AbstractModel {
path.pop();
folder.parentName = path.join(folder.delimiter);
folder.isSubscribed(folder.flags.includes('\\subscribed'));
folder.exists = !folder.flags.includes('\\nonexistent');
folder.selectable(folder.exists && !folder.flags.includes('\\noselect'));
type && 'mail' != type && folder.kolabType(type);
}
return folder;