[FIX] im_livechat: do not willStart when livechat unavailable

Follow-up of https://github.com/odoo/odoo/pull/98160

PR above made single app im_livechat tests sometimes fail with
following error:

```
TypeError: LivechatController.livechat_init() missing 1 required positional argument: 'channel_id'
```

This comes from RPC `/im_livechat/init` in frontend, which must
provide `channel_id` but somehow doesn't sometimes.

This only happens with `test_im_livechat_support_page`, sometimes on runbot.

Task-2969488

closes odoo/odoo#99385

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This commit is contained in:
Alexandre Kühn
2022-09-01 15:33:25 +02:00
parent 091e54ca17
commit 449d76dbca
@@ -26,7 +26,9 @@ registerModel({
}
set_cookie(this.LIVECHAT_COOKIE_HISTORY, JSON.stringify(urlHistory), 60 * 60 * 24); // 1 day cookie
}
this.willStart();
if (this.isAvailable) {
this.willStart();
}
},
},
recordMethods: {