[FIX] mail: prevent crash when using channel palette before init

`joinChannel` expects messaging to be initialized (in particular to
access store user) but doesn't actually wait for it.

Part-of: odoo/odoo#144580
This commit is contained in:
Sébastien Theys
2023-12-04 13:23:38 +00:00
parent a4b21bf5c8
commit 9342f8ab2d
@@ -535,6 +535,7 @@ export class ThreadService {
}
async joinChannel(id, name) {
await this.env.services["mail.messaging"].isReady;
await this.orm.call("discuss.channel", "add_members", [[id]], {
partner_ids: [this.store.user.id],
});