Fixed file delete
This commit is contained in:
parent
450e1cf9ca
commit
694e30de9d
15
js/core.js
15
js/core.js
@ -556,6 +556,21 @@ define(
|
||||
});
|
||||
version = "v2";
|
||||
}
|
||||
|
||||
// Upgrade from v2 to v3
|
||||
if(version == "v2") {
|
||||
var fileIndexList = _.compact(localStorage["file.list"].split(";"));
|
||||
_.each(fileIndexList, function(fileIndex) {
|
||||
if(!_.has(localStorage, fileIndex + ".sync")) {
|
||||
localStorage.removeItem(fileIndex + ".title");
|
||||
localStorage.removeItem(fileIndex + ".publish");
|
||||
localStorage.removeItem(fileIndex + ".content");
|
||||
localStorage["file.list"] = localStorage["file.list"].replace(";"
|
||||
+ fileIndex + ";", ";");
|
||||
}
|
||||
});
|
||||
version = "v3";
|
||||
}
|
||||
localStorage["version"] = version;
|
||||
}
|
||||
// Setup the localStorage when starting
|
||||
|
@ -89,17 +89,17 @@ define(["jquery", "core", "synchronizer", "publisher", "underscore"],
|
||||
|
||||
// Remove synchronized locations
|
||||
var syncIndexList = _.compact(localStorage[fileIndex + ".sync"].split(";"));
|
||||
localStorage.removeItem(fileIndex + ".sync");
|
||||
_.each(syncIndexList, function(syncIndex) {
|
||||
fileManager.removeSync(syncIndex);
|
||||
});
|
||||
localStorage.removeItem(fileIndex + ".sync");
|
||||
|
||||
// Remove publish locations
|
||||
var publishIndexList = _.compact(localStorage[fileIndex + ".publish"].split(";"));
|
||||
localStorage.removeItem(fileIndex + ".publish");
|
||||
_.each(publishIndexList, function(publishIndex) {
|
||||
fileManager.removePublish(publishIndex);
|
||||
});
|
||||
localStorage.removeItem(fileIndex + ".publish");
|
||||
|
||||
localStorage["file.list"] = localStorage["file.list"].replace(";"
|
||||
+ fileIndex + ";", ";");
|
||||
|
Loading…
Reference in New Issue
Block a user