Przeglądaj źródła

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.
JC Brand 6 lat temu
rodzic
commit
45ed506551
2 zmienionych plików z 6 dodań i 2 usunięć
  1. 4 1
      dist/converse.js
  2. 2 1
      src/converse-omemo.js

+ 4 - 1
dist/converse.js

@@ -56968,7 +56968,10 @@ _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].plugins
       initialize() {
         this.devices = new _converse.Devices();
         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();
       },
 

+ 2 - 1
src/converse-omemo.js

@@ -944,7 +944,8 @@ converse.plugins.add('converse-omemo', {
             initialize () {
                 this.devices = new _converse.Devices();
                 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();
             },