Merge pull request #1735 from sumpfralle/olsr-jsoninfo-parser-handle-empty-result
[oweals/luci.git] / modules / luci-base / htdocs / luci-static / resources / luci.js
index 1d349ebc1735e26278a489fd846c6d39b1e7f95c..4e3c8445a94dc0013a20708e4744f622e7c9c951 100644 (file)
                },
 
                probeSystemFeatures: function() {
+                       var sessionid = classes.rpc.getSessionID();
+
                        if (sysFeatures == null) {
                                try {
-                                       sysFeatures = JSON.parse(window.sessionStorage.getItem('sysFeatures'));
+                                       var data = JSON.parse(window.sessionStorage.getItem('sysFeatures'));
+
+                                       if (this.isObject(data) && this.isObject(data[sessionid]))
+                                               sysFeatures = data[sessionid];
                                }
                                catch (e) {}
                        }
                                        expect: { '': {} }
                                })().then(function(features) {
                                        try {
-                                               window.sessionStorage.setItem('sysFeatures', JSON.stringify(features));
+                                               var data = {};
+                                                   data[sessionid] = features;
+
+                                               window.sessionStorage.setItem('sysFeatures', JSON.stringify(data));
                                        }
                                        catch (e) {}