Prevent loading loop between MessageList and FolderInformation requests

This commit is contained in:
the-djmaze 2023-02-06 13:54:03 +01:00
parent 9cec77ecc1
commit 88bfa5663f

View file

@ -205,7 +205,6 @@ MessagelistUserStore.reload = (bDropPagePosition = false, bDropCurrentFolderCach
const collection = MessageCollectionModel.reviveFromJson(oData.Result, bCached); const collection = MessageCollectionModel.reviveFromJson(oData.Result, bCached);
if (collection) { if (collection) {
error = ''; error = '';
let unreadCountChange = false;
const const
folder = getFolderFromCacheList(collection.folder), folder = getFolderFromCacheList(collection.folder),
@ -222,7 +221,6 @@ MessagelistUserStore.reload = (bDropPagePosition = false, bDropCurrentFolderCach
if (null != folderInfo.unreadEmails) { if (null != folderInfo.unreadEmails) {
if (pInt(folder.unreadEmails()) !== pInt(folderInfo.unreadEmails)) { if (pInt(folder.unreadEmails()) !== pInt(folderInfo.unreadEmails)) {
unreadCountChange = true;
MessageFlagsCache.clearFolder(folder.fullName); MessageFlagsCache.clearFolder(folder.fullName);
} }
folder.unreadEmails(folderInfo.unreadEmails); folder.unreadEmails(folderInfo.unreadEmails);
@ -279,10 +277,6 @@ MessagelistUserStore.reload = (bDropPagePosition = false, bDropCurrentFolderCach
MessagelistUserStore(collection); MessagelistUserStore(collection);
MessagelistUserStore.isIncomplete(false); MessagelistUserStore.isIncomplete(false);
if (folder && (bCached || unreadCountChange || SettingsUserStore.useThreads())) {
rl.app.folderInformation(folder.fullName, collection);
}
} else { } else {
MessagelistUserStore.count(0); MessagelistUserStore.count(0);
MessagelistUserStore([]); MessagelistUserStore([]);