Improvement for #518

This commit is contained in:
the-djmaze 2022-09-13 23:00:26 +02:00
parent b01b18647a
commit 1d982f3306

View file

@ -193,17 +193,18 @@ MessagelistUserStore.reload = (bDropPagePosition = false, bDropCurrentFolderCach
} }
MessagelistUserStore.loading(true); MessagelistUserStore.loading(true);
MessagelistUserStore.error('');
Remote.messageList( Remote.messageList(
(iError, oData, bCached) => { (iError, oData, bCached) => {
let error = '';
if (iError) { if (iError) {
error = getNotification(iError);
if (Notification.RequestAborted !== iError) { if (Notification.RequestAborted !== iError) {
MessagelistUserStore([]); MessagelistUserStore([]);
} }
MessagelistUserStore.error(getNotification(iError));
} else { } else {
const collection = MessageCollectionModel.reviveFromJson(oData.Result, bCached); const collection = MessageCollectionModel.reviveFromJson(oData.Result, bCached);
if (collection) { if (collection) {
error = '';
let unreadCountChange = false; let unreadCountChange = false;
const const
@ -273,8 +274,9 @@ MessagelistUserStore.reload = (bDropPagePosition = false, bDropCurrentFolderCach
} else { } else {
MessagelistUserStore.count(0); MessagelistUserStore.count(0);
MessagelistUserStore([]); MessagelistUserStore([]);
MessagelistUserStore.error(getNotification(Notification.CantGetMessageList)); error = getNotification(Notification.CantGetMessageList);
} }
MessagelistUserStore.error(error);
} }
MessagelistUserStore.loading(false); MessagelistUserStore.loading(false);
}, },