[FIX] im_livechat: fix livechat service thread getter

The livechat service thread getter relies on the thread type to find
the current livechat thread. Since guest could have many channels it
is incomplete, the id should also be checked. This PR fixes this issue.

closes odoo/odoo#135378

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit is contained in:
tsm-odoo
2023-09-13 17:43:11 +00:00
parent de8e25ce6c
commit ed020e9889
@@ -257,7 +257,9 @@ export class LivechatService {
* @returns {import("@mail/core/common/thread_model").Thread|undefined}
*/
get thread() {
return Object.values(this.store.Thread.records).find(({ type }) => type === "livechat");
return Object.values(this.store.Thread.records).find(
({ id, type }) => type === "livechat" && id === this.sessionCookie?.id
);
}
get visitorUid() {