From aa684fe52e08613d435e33b0b0f4303525ed2888 Mon Sep 17 00:00:00 2001 From: Tyler Renelle Date: Mon, 3 Jun 2013 14:20:22 -0400 Subject: [PATCH] comments on cron stuff --- src/app/index.coffee | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/app/index.coffee b/src/app/index.coffee index bde4b038d7..ea0d31781a 100644 --- a/src/app/index.coffee +++ b/src/app/index.coffee @@ -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)