mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 20:42:22 +02:00
MDL-67700 message: prevent async loading conversation message mix
This commit is contained in:
parent
99374e7e14
commit
778846987a
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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user