[IMP] mail: prevent useless render of message view
Avoid observing the last message view just for checking the state of self. task-2800990 closes odoo/odoo#87003 Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit is contained in:
@@ -40,7 +40,7 @@ registerModel({
|
||||
this.highlight();
|
||||
this.update({ doHighlight: clear() });
|
||||
}
|
||||
if (this.threadView && this.threadView.lastMessageView === this && this.component && this.component.isPartiallyVisible()) {
|
||||
if (this.threadViewOwnerAsLastMessageView && this.component && this.component.isPartiallyVisible()) {
|
||||
this.threadView.handleVisibleMessage(this.message);
|
||||
}
|
||||
},
|
||||
@@ -268,5 +268,13 @@ registerModel({
|
||||
inverse: 'messageViews',
|
||||
readonly: true,
|
||||
}),
|
||||
/**
|
||||
* States whether this message view is the last one of its thread view.
|
||||
* Computed from inverse relation.
|
||||
*/
|
||||
threadViewOwnerAsLastMessageView: one('ThreadView', {
|
||||
inverse: 'lastMessageView',
|
||||
readonly: true,
|
||||
}),
|
||||
},
|
||||
});
|
||||
|
||||
@@ -438,6 +438,8 @@ registerModel({
|
||||
}),
|
||||
lastMessageView: one('MessageView', {
|
||||
compute: '_computeLastMessageView',
|
||||
inverse: 'threadViewOwnerAsLastMessageView',
|
||||
readonly: true,
|
||||
}),
|
||||
/**
|
||||
* Most recent message in this ThreadView that has been shown to the
|
||||
|
||||
Reference in New Issue
Block a user