[FIX] bus: fix im status service listeners

The im status service subscribes to the `become_main_tab`,
`no_longer_main_tab` events.

Since the PR improving the multi tab service, the multi tab
itself is not an event target anymore but exposes a bus instance
that should be used to subscribe to those events.

The im status service is still based on the first version (that was
using env.bus) which means the event will never be received. This
commit fixes this issue.

closes odoo/odoo#99635

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This commit is contained in:
tsm-odoo
2022-09-07 02:17:50 +02:00
parent b5ce1e39d7
commit 29bd02e9b8
+2 -2
View File
@@ -37,9 +37,9 @@ export const imStatusService = {
if (multi_tab.isOnMainTab()) {
startUpdatingBusPresence();
}
env.bus.addEventListener('become_main_tab', startUpdatingBusPresence);
multi_tab.bus.addEventListener('become_main_tab', startUpdatingBusPresence);
bus_service.addEventListener('reconnect', startUpdatingBusPresence);
env.bus.addEventListener('no_longer_main_tab', stopUpdatingBusPresence);
multi_tab.bus.addEventListener('no_longer_main_tab', stopUpdatingBusPresence);
bus_service.addEventListener('disconnect', stopUpdatingBusPresence);
},
};