[FIX] mail: avoid flicker when uploading multiple attachement
task-2282327 closes odoo/odoo#58358 X-original-commit: 413c6c406eac52048b9a0b80c7ee46efe5b061c4 Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit is contained in:
@@ -883,7 +883,17 @@ function factory(dependencies) {
|
||||
*/
|
||||
_computeAllAttachments() {
|
||||
const allAttachments = [...new Set(this.originThreadAttachments.concat(this.attachments))]
|
||||
.sort((a1, a2) => a1.id < a2.id ? 1 : -1);
|
||||
.sort((a1, a2) => {
|
||||
// "uploading" before "uploaded" attachments.
|
||||
if (!a1.isTemporary && a2.isTemporary) {
|
||||
return 1;
|
||||
}
|
||||
if (a1.isTemporary && !a2.isTemporary) {
|
||||
return -1;
|
||||
}
|
||||
// "most-recent" before "oldest" attachments.
|
||||
return Math.abs(a2.id) - Math.abs(a1.id);
|
||||
});
|
||||
return [['replace', allAttachments]];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user