[editor] Fail gracefully when the browser cache is full
@@ -184,6 +184,7 @@ var ApiHelper = (function () {
*/
ApiHelper.prototype.setInTotalStorage = function(owner, id, value) {
var self = this;
+ try {
var cachedData = $.totalStorage("hue.user.settings." + self.getTotalStorageUserPrefix(owner)) || {};
if (typeof value !== 'undefined' && value !== null) {
cachedData[id] = value;
@@ -192,6 +193,7 @@ var ApiHelper = (function () {
delete cachedData[id];
$.totalStorage("hue.user.settings." + self.getTotalStorageUserPrefix(owner), cachedData, { secure: window.location.protocol.indexOf('https') > -1 });
}
+ } catch (e) {}
};
/**
@@ -1872,7 +1874,9 @@ var ApiHelper = (function () {
timestamp: (new Date()).getTime(),
data: data
};
+ try {
$.totalStorage(cacheIdentifier, cachedData);
+ } catch (e) {}
});
} else {
if (options.promise) {
