From 3e290b4734da3fb5ccf070870725b8f434caee17 Mon Sep 17 00:00:00 2001 From: Tyler Renelle Date: Tue, 14 Jan 2014 17:46:08 -0700 Subject: [PATCH] Revert auto-clearing completed to-dos, instead we'll hide stale completeds from our angular app --- dist/habitrpg-shared.js | 3 --- locales/en/main.json | 2 +- script/index.coffee | 3 --- tests/algos.mocha.coffee | 25 ------------------------- 4 files changed, 1 insertion(+), 32 deletions(-) diff --git a/dist/habitrpg-shared.js b/dist/habitrpg-shared.js index 2496d5b804..bdf793fad5 100644 --- a/dist/habitrpg-shared.js +++ b/dist/habitrpg-shared.js @@ -12404,9 +12404,6 @@ var process=require("__browserify_process");(function() { if (user.stats.mp > user._statsComputed.maxMP) { user.stats.mp = user._statsComputed.maxMP; } - user.todos = _.where(user.todos, function(t) { - return !t.completed || moment(t.created).isAfter(moment().subtract('days', 3)); - }); if (user.preferences.sleep === true) { user.stats.buffs = { str: 0, diff --git a/locales/en/main.json b/locales/en/main.json index 936de9c045..357587eaa9 100644 --- a/locales/en/main.json +++ b/locales/en/main.json @@ -88,7 +88,7 @@ "_commentlists" : "LISTS", "clearCompleted" : "Clear Completed", - "lotOfToDos" : "Completed To-Dos are automatically cleared after 3 days. Be sure to save any need information elswhere.", + "lotOfToDos" : "Completed To-Dos are automatically archived after 3 days. You can access them from Options > Settings > Data Export.", "mp" : "MP", diff --git a/script/index.coffee b/script/index.coffee index a5c54dc793..b9aa8cfd07 100644 --- a/script/index.coffee +++ b/script/index.coffee @@ -1136,9 +1136,6 @@ api.wrap = (user, main=true) -> user.stats.mp += _.max([10,.1 * user._statsComputed.maxMP]) user.stats.mp = user._statsComputed.maxMP if user.stats.mp > user._statsComputed.maxMP - user.todos = _.where user.todos, (t) -> - !t.completed or moment(t.created).isAfter(moment().subtract('days',3)) - # User is resting at the inn. Used to be we un-checked each daily without performing calculation (see commits before fb29e35) # but to prevent abusing the inn (http://goo.gl/GDb9x) we now do *not* calculate dailies, and simply set lastCron to today if user.preferences.sleep is true diff --git a/tests/algos.mocha.coffee b/tests/algos.mocha.coffee index 86e07ffaf8..c398774d45 100644 --- a/tests/algos.mocha.coffee +++ b/tests/algos.mocha.coffee @@ -137,31 +137,6 @@ describe 'User', -> user.items.gear.equipped.weapon = 'weapon_wizard_1' expect(user._statsComputed.maxMP).to.eql 63 - it 'Clears old To-Dos', -> - user = newUser() - shared.wrap(user) - cron = -> user.lastCron = moment().subtract('days',1);user.fns.cron({}) - user.todos = [] - _.times 3, (i)-> user.todos.push shared.taskDefaults({type:'todo',text:i}) - - # Fresh todos, no change - cron() - expect(_.size(user.todos)).to.be 3 - - # Complete Todos, no change - _.each user.todos, (t)->t.created = moment().subtract('days',4) - cron() - expect(_.size(user.todos)).to.be 3 - - user.todos[0].completed = true - user.todos[1].completed = true - cron() - expect(_.size(user.todos)).to.be 1 - - user.todos[0].completed = true - cron() - expect(_.size(user.todos)).to.be 0 - describe 'Death', -> user = undefined it 'revives correctly', ->