From 4ad896bd3d6bbc851a59adead1a653abc31fc882 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Mon, 27 Aug 2018 09:46:38 +0200 Subject: [PATCH] [FIX] bus: Displays messages when loading the page with multiple tabs If we use the cross tab, and the session has more than 50 seconds (or does not exist), a remove is done in the init. The change trigger in local storage causes the value of _lastNotificationID to become null. This causes a loading error in the long poll. --- addons/bus/static/src/js/crosstab_bus.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/addons/bus/static/src/js/crosstab_bus.js b/addons/bus/static/src/js/crosstab_bus.js index 13e6cdb98cc..261debfcc54 100644 --- a/addons/bus/static/src/js/crosstab_bus.js +++ b/addons/bus/static/src/js/crosstab_bus.js @@ -304,28 +304,26 @@ var CrossTabBus = Longpolling.extend({ // last notification id changed if (key === this._generateKey('last')) { - this._lastNotificationID = value; + this._lastNotificationID = value || -1; } // notifications changed - - if (key === this._generateKey('notification')) { + else if (key === this._generateKey('notification')) { if (!this._isMasterTab) { this.trigger("notification", value); } - return; } // update channels - if (key === this._generateKey('channels')) { + else if (key === this._generateKey('channels')) { var channels = value; _.each(_.difference(this._channels, channels), this.deleteChannel.bind(this)); _.each(_.difference(channels, this._channels), this.addChannel.bind(this)); } // update options - if (key === this._generateKey('options')) { + else if (key === this._generateKey('options')) { this._options = value; } // update focus - if (key === this._generateKey('focus')) { + else if (key === this._generateKey('focus')) { this._isOdooFocused = value; this.trigger('window_focus', this._isOdooFocused); }