mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-05-25 23:25:51 +00:00
Revert auto-clearing completed to-dos, instead we'll hide stale completeds from our angular app
This commit is contained in:
parent
d822cdc9eb
commit
3e290b4734
4 changed files with 1 additions and 32 deletions
3
dist/habitrpg-shared.js
vendored
3
dist/habitrpg-shared.js
vendored
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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', ->
|
||||
|
|
|
|||
Loading…
Reference in a new issue