Improve the LessLoader check to hopefully stop the message saying cookies were blocked.

pull/1/head
Caleb James DeLisle 7 years ago
parent 72f03b2a47
commit f418ee9632

@ -9,18 +9,20 @@ define([
var module = { exports: {} }; var module = { exports: {} };
var key = Config.requireConf.urlArgs; var key = Config.requireConf.urlArgs;
var localStorage = {}; var localStorage = {};
try { if (!window.cryptpadCache) {
localStorage = window.localStorage || {}; try {
if (localStorage['LESS_CACHE'] !== key) { localStorage = window.localStorage || {};
Object.keys(localStorage).forEach(function (k) { if (localStorage['LESS_CACHE'] !== key) {
if (k.indexOf('LESS_CACHE|') !== 0) { return; } Object.keys(localStorage).forEach(function (k) {
delete localStorage[k]; if (k.indexOf('LESS_CACHE|') !== 0) { return; }
}); delete localStorage[k];
localStorage['LESS_CACHE'] = key; });
localStorage['LESS_CACHE'] = key;
}
} catch (e) {
console.error(e);
localStorage = {};
} }
} catch (e) {
console.error(e);
localStorage = {};
} }
var cacheGet = function (k, cb) { var cacheGet = function (k, cb) {

Loading…
Cancel
Save