Don't hardcode devices storage to session storage.

The devicelists are not stored in session storage, so we end up with
fetching all the devices per stored devicelist with every new browser
session.
This commit is contained in:
JC Brand 2018-12-21 06:20:37 +01:00
parent e6c66cfebd
commit 45ed506551
2 changed files with 6 additions and 2 deletions

5
dist/converse.js vendored
View File

@ -56968,7 +56968,10 @@ _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].plugins
initialize() { initialize() {
this.devices = new _converse.Devices(); this.devices = new _converse.Devices();
const id = `converse.devicelist-${_converse.bare_jid}-${this.get('jid')}`; const id = `converse.devicelist-${_converse.bare_jid}-${this.get('jid')}`;
this.devices.browserStorage = new Backbone.BrowserStorage.session(id);
const storage = _converse.config.get('storage');
this.devices.browserStorage = new Backbone.BrowserStorage[storage](id);
this.fetchDevices(); this.fetchDevices();
}, },

View File

@ -944,7 +944,8 @@ converse.plugins.add('converse-omemo', {
initialize () { initialize () {
this.devices = new _converse.Devices(); this.devices = new _converse.Devices();
const id = `converse.devicelist-${_converse.bare_jid}-${this.get('jid')}`; const id = `converse.devicelist-${_converse.bare_jid}-${this.get('jid')}`;
this.devices.browserStorage = new Backbone.BrowserStorage.session(id); const storage = _converse.config.get('storage');
this.devices.browserStorage = new Backbone.BrowserStorage[storage](id);
this.fetchDevices(); this.fetchDevices();
}, },