diff options
| author | Christophe Matthieu <chm@odoo.com> | 2018-08-27 09:46:38 +0200 |
|---|---|---|
| committer | Christophe Matthieu <chm@odoo.com> | 2018-09-10 16:46:29 +0200 |
| commit | 4ad896bd3d6bbc851a59adead1a653abc31fc882 (patch) | |
| tree | 1455391ae7c14133cfc60f8c37f30d9423c89dc4 /addons/bus/static | |
| parent | 737ba55e1ee34e8ae26d0904baa80111900e8dea (diff) | |
[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.
Diffstat (limited to 'addons/bus/static')
| -rw-r--r-- | addons/bus/static/src/js/crosstab_bus.js | 12 |
1 files 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); } |
