Fix LESS cache

pull/1/head
yflory 4 years ago
parent 3084cf7129
commit e25b87534e

@ -121,19 +121,20 @@ define([
lessEngine.FileManager.prototype.doXHR = function (url, type, callback, errback) { lessEngine.FileManager.prototype.doXHR = function (url, type, callback, errback) {
console.error(url, COLORTHEME); // XXX console.error(url, COLORTHEME); // XXX
var col = false; var col = false;
var _url = url;
if (url === COLORTHEME) { if (url === COLORTHEME) {
col = true; col = true;
url = getColorthemeURL(); url = getColorthemeURL();
console.warn(url); console.warn(url);
} }
url = fixURL(url); url = fixURL(url);
var cached = tempCache[url]; var cached = tempCache[_url];
if (cached && cached.res) { if (cached && cached.res) {
var res = cached.res; var res = cached.res;
return void setTimeout(function () { callback(res[0], res[1]); }); return void setTimeout(function () { callback(res[0], res[1]); });
} }
if (cached) { return void cached.queue.push(callback); } if (cached) { return void cached.queue.push(callback); }
cached = tempCache[url] = { queue: [ callback ], res: undefined }; cached = tempCache[_url] = { queue: [ callback ], res: undefined };
return doXHR(url, type, function (text, lastModified) { return doXHR(url, type, function (text, lastModified) {
if (col) { if (col) {
console.warn(text, lastModified); console.warn(text, lastModified);

Loading…
Cancel
Save