comments on cron stuff

This commit is contained in:
Tyler Renelle
2013-06-03 14:20:22 -04:00
parent f8e546ae2a
commit aa684fe52e
+3
View File
@@ -129,7 +129,10 @@ ready (model) ->
# habitrpg-shared/algos requires uObj.habits, uObj.dailys etc instead of uObj.tasks
_.each ['habit','daily','todo','reward'], (type) -> uObj["#{type}s"] = _.where(uObj.tasks, {type}); true
algos.cron uObj, {paths}
# for new user, just set lastCron - no need to reset dom.
# remember that the properties are set from uObj & paths AFTER the return of this callback
return if _.isEmpty(paths) or (paths['lastCron'] and _.size(paths) is 1)
# for everyone else, we need to reset dom - too many changes have been made and won't it breaks dom listeners.
if lostHp = delete paths['stats.hp'] # we'll set this manually so we can get a cool animation
setTimeout ->
browser.resetDom(model)