mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 04:59:21 +03:00
New thread list logic (step 2)
This commit is contained in:
parent
b656b6365b
commit
03d26bc4c6
18 changed files with 139 additions and 517 deletions
|
|
@ -29,44 +29,10 @@
|
|||
function UserAjaxUserPromises()
|
||||
{
|
||||
AbstractAjaxPromises.call(this);
|
||||
|
||||
this.messageListSimpleHash = '';
|
||||
this.messageListSimpleCache = null;
|
||||
}
|
||||
|
||||
_.extend(UserAjaxUserPromises.prototype, AbstractAjaxPromises.prototype);
|
||||
|
||||
UserAjaxUserPromises.prototype.messageListSimple = function (sFolder, aUids, fTrigger)
|
||||
{
|
||||
var self = this, sHash = sFolder + '~' + aUids.join('/');
|
||||
if (sHash === this.messageListSimpleHash && this.messageListSimpleCache)
|
||||
{
|
||||
return this.fastResolve(this.messageListSimpleCache);
|
||||
}
|
||||
|
||||
return this.abort('MessageListSimple')
|
||||
.postRequest('MessageListSimple', fTrigger, {
|
||||
'Folder': sFolder,
|
||||
'Uids': aUids
|
||||
}).then(function (oData) {
|
||||
|
||||
self.messageListSimpleHash = sHash;
|
||||
self.messageListSimpleCache = _.compact(_.map(oData.Result, function (aItem) {
|
||||
return MessageSimpleModel.newInstanceFromJson(aItem);
|
||||
}));
|
||||
|
||||
return self.messageListSimpleCache;
|
||||
|
||||
}, function (iError) {
|
||||
|
||||
self.messageListSimpleHash = '';
|
||||
self.messageListSimpleCache = null;
|
||||
|
||||
return self.fastReject(iError);
|
||||
})
|
||||
;
|
||||
};
|
||||
|
||||
UserAjaxUserPromises.prototype.foldersReload = function (fTrigger)
|
||||
{
|
||||
return this.abort('Folders')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue