Merge branch 'MDL-67700-38' of git://github.com/ferranrecio/moodle into MOODLE_38_STABLE

This commit is contained in:
Andrew Nicols
2020-05-22 10:51:47 +08:00
3 changed files with 17 additions and 6 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -506,6 +506,18 @@ function(
newestFirst,
timeFrom
)
.then(function(result) {
// Prevent older requests from contaminating the current view.
if (result.id != viewState.id) {
result.messages = [];
// Purge old conversation cache to prevent messages lose.
if (result.id in stateCache) {
delete stateCache[result.id];
}
}
return result;
})
.then(function(result) {
if (result.messages.length && ignoreList.length) {
result.messages = result.messages.filter(function(message) {
@@ -1865,6 +1877,9 @@ function(
var resetState = function(body, conversationId, loggedInUserProfile) {
// Reset all of the states back to the beginning if we're loading a new
// conversation.
if (newMessagesPollTimer) {
newMessagesPollTimer.stop();
}
loadedAllMessages = false;
messagesOffset = 0;
newMessagesPollTimer = null;
@@ -1893,10 +1908,6 @@ function(
viewState = initialState;
}
if (newMessagesPollTimer) {
newMessagesPollTimer.stop();
}
render(initialState);
};