move auto archive hook closer to the save call

This commit is contained in:
Morgan McMillian 2012-12-02 06:37:10 -05:00
parent e8a26a6b4d
commit 219415f434

View file

@ -280,9 +280,6 @@ enyo.kind({
this.cacheChanges = "COMMIT"; this.cacheChanges = "COMMIT";
this.owner.addTodo(); this.owner.addTodo();
this.completeItem = false; this.completeItem = false;
if (this.owner.preferences["archive"] == true) {
this.owner.autoarchive = true;
}
this.$.todoPopup.close(); this.$.todoPopup.close();
}, },
@ -338,6 +335,9 @@ enyo.kind({
} }
this.listRefresh(); this.listRefresh();
if (this.owner.preferences["storage"] != "none" && this.cacheChanges != "START" && this.cacheChanges != "YES") { if (this.owner.preferences["storage"] != "none" && this.cacheChanges != "START" && this.cacheChanges != "YES") {
if (this.owner.preferences["archive"] == true && this.completeItem) {
this.owner.autoarchive = true;
}
console.log("saving list"); console.log("saving list");
this.owner.saveFile( this.owner.saveFile(
this.owner.preferences["filepath"], this.owner.todoList); this.owner.preferences["filepath"], this.owner.todoList);