[FIX] mail: jump to pinned message from notification

Before this commit, when pinning an old message from thread,
then page reload then click on pinned message link in
notification message in thread at time of pinning message,
it fails to jump to the pinned message.

This happens because the message is not in the store, therefore
it attempts to jump to message `undefined`, which doesn't exist.

This commit fixes the issue by inserting the message before
attempting the highlighting that will jump to the message.

closes odoo/odoo#134818

X-original-commit: 70769963d240add98ed2ee231412201434a825ba
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit is contained in:
Alexandre Kühn
2023-09-08 13:45:41 +00:00
parent 29097e10d8
commit 640a11a56e
+5 -1
View File
@@ -202,7 +202,11 @@ export class Thread extends Component {
const { oeType, oeId } = ev.target.dataset;
if (oeType === "highlight") {
await this.env.messageHighlight?.highlightMessage(
this.store.Message.get(Number(oeId)),
this.store.Message.insert({
id: Number(oeId),
resId: this.props.thread.id,
resModel: this.props.thread.model,
}),
this.props.thread
);
}