[IMP] web_notify: add channels only if not done already

pull/2412/head
Juan Jose Scarafia 2020-07-24 23:23:49 -03:00 committed by Benoit Aimont
parent e8256684bf
commit 32d2b9f8f5
1 changed files with 9 additions and 6 deletions

View File

@ -24,13 +24,16 @@ odoo.define("web_notify.WebClient", function(require) {
this.channel_info,
this.channel_default,
];
this.call("bus_service", "addChannel", this.channel_success);
this.call("bus_service", "addChannel", this.channel_danger);
this.call("bus_service", "addChannel", this.channel_warning);
this.call("bus_service", "addChannel", this.channel_info);
this.call("bus_service", "addChannel", this.channel_default);
this.call("bus_service", "on", "notification", this, this.bus_notification);
this.call("bus_service", "startPolling");
if (this.call("bus_service", "isMasterTab")) {
this.call("bus_service", "addChannel", this.channel_success);
this.call("bus_service", "addChannel", this.channel_danger);
this.call("bus_service", "addChannel", this.channel_warning);
this.call("bus_service", "addChannel", this.channel_info);
this.call("bus_service", "addChannel", this.channel_default);
}
this.call("bus_service", "on", "notification", this, this.bus_notification);
},
bus_notification: function(notifications) {
var self = this;