mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
Merge branch 'MDL-67700-master' of git://github.com/ferranrecio/moodle
This commit is contained in:
commit
c225a42c19
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);
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user