fix(mail(js)): update visible msgs list when adding new msgs
parent
a8c684cdad
commit
0599922016
|
@ -980,7 +980,7 @@
|
||||||
this.$futureMailboxData.then(function(data) {
|
this.$futureMailboxData.then(function(data) {
|
||||||
var selectedMessages = _.map(_this.$selectedMessages, 'uid');
|
var selectedMessages = _.map(_this.$selectedMessages, 'uid');
|
||||||
Mailbox.$timeout(function() {
|
Mailbox.$timeout(function() {
|
||||||
var uids, headers, headersFields, msgObject;
|
var uids, headers, headersFields, msgObject, hasNewMessages = false;
|
||||||
|
|
||||||
if (!data.uids || _this.$topIndex > data.uids.length - 1)
|
if (!data.uids || _this.$topIndex > data.uids.length - 1)
|
||||||
_this.$topIndex = 0;
|
_this.$topIndex = 0;
|
||||||
|
@ -1004,6 +1004,7 @@
|
||||||
// New messsage; update map of UID <=> index
|
// New messsage; update map of UID <=> index
|
||||||
_this.uidsMap[uid] = i;
|
_this.uidsMap[uid] = i;
|
||||||
_this.$messages.splice(i, 0, {uid: uid});
|
_this.$messages.splice(i, 0, {uid: uid});
|
||||||
|
hasNewMessages = true;
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -1014,9 +1015,6 @@
|
||||||
msgObject = _this.$messages[j];
|
msgObject = _this.$messages[j];
|
||||||
_this.uidsMap[msgObject.uid] += i;
|
_this.uidsMap[msgObject.uid] += i;
|
||||||
}
|
}
|
||||||
if (_this.threaded) {
|
|
||||||
_this.updateVisibleMessages();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (data.unseenCount) {
|
if (data.unseenCount) {
|
||||||
|
@ -1090,6 +1088,10 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (hasNewMessages && _this.threaded) {
|
||||||
|
_this.updateVisibleMessages();
|
||||||
|
}
|
||||||
|
|
||||||
Mailbox.$log.debug('mailbox ' + _this.id + ' ready');
|
Mailbox.$log.debug('mailbox ' + _this.id + ' ready');
|
||||||
_this.$isLoading = false;
|
_this.$isLoading = false;
|
||||||
deferred.resolve(_this.$messages);
|
deferred.resolve(_this.$messages);
|
||||||
|
|
Loading…
Reference in New Issue