From 219415f43466526dde541a0fe2be2d9300cfd2ed Mon Sep 17 00:00:00 2001 From: Morgan McMillian Date: Sun, 2 Dec 2012 06:37:10 -0500 Subject: [PATCH] move auto archive hook closer to the save call --- app/source/TodoList.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/source/TodoList.js b/app/source/TodoList.js index dce2703..04e466d 100644 --- a/app/source/TodoList.js +++ b/app/source/TodoList.js @@ -280,9 +280,6 @@ enyo.kind({ this.cacheChanges = "COMMIT"; this.owner.addTodo(); this.completeItem = false; - if (this.owner.preferences["archive"] == true) { - this.owner.autoarchive = true; - } this.$.todoPopup.close(); }, @@ -338,6 +335,9 @@ enyo.kind({ } this.listRefresh(); 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"); this.owner.saveFile( this.owner.preferences["filepath"], this.owner.todoList);