[FIX] mail: click on link in a message preview while replying

When clicking on a mention (or a link) within the preview of the
message we're replying to, there was a traceback because we tried
to update a component which has already been deleted.

closes odoo/odoo#83912

Task-id: 2747321
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This commit is contained in:
Julien Giannone
2022-02-03 15:22:14 +00:00
parent 8bf732f050
commit c4bbe13fdf
2 changed files with 6 additions and 0 deletions
@@ -337,6 +337,9 @@ export class MessageList extends Component {
* @param {ScrollEvent} ev
*/
_onScrollThrottled(ev) {
if (!this.messageListView) {
return;
}
const {
orderedMessages,
thread,
@@ -17,6 +17,9 @@ registerModel({
this.update({
isHighlighted: true,
highlightTimeout: this.env.browser.setTimeout(() => {
if (!this.exists()) {
return;
}
this.update({ isHighlighted: false });
}, 2000),
});