|
|
|
@ -95,17 +95,6 @@ cdb.config.prefixUrlPathname = function() {
|
|
|
|
|
throw new Error("cachedSync needs a namespace as argument");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// check for free space
|
|
|
|
|
try {
|
|
|
|
|
localStorage.setItem("WRITE_TEST", CARTODB_UI_VERSION);
|
|
|
|
|
if (CARTODB_UI_VERSION !== localStorage.getItem("WRITE_TEST")) {
|
|
|
|
|
throw new Error("failed");
|
|
|
|
|
}
|
|
|
|
|
} catch (e) {
|
|
|
|
|
cdb.log.debug("datastore is full, not using cached sync");
|
|
|
|
|
return Backbone.sync;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var surrogateKey = namespace;
|
|
|
|
|
var session = window.user_data && window.user_data.username;
|
|
|
|
|
// no user session, no cache
|
|
|
|
@ -284,16 +273,3 @@ function applyPatchNewVisualizationUrl() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// clears localstore if the cartodb frontend version has changed
|
|
|
|
|
function clearLocalstore() {
|
|
|
|
|
if (CARTODB_UI_VERSION !== localStorage.getItem("CARTODB_UI_VERSION")) {
|
|
|
|
|
localStorage.clear();
|
|
|
|
|
localStorage.setItem("CARTODB_UI_VERSION", CARTODB_UI_VERSION);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$(function() {
|
|
|
|
|
clearLocalstore();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|