mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-05 12:02:13 +00:00
put reset dom back in
This commit is contained in:
parent
90af514fbc
commit
f0f565e5cc
2 changed files with 3 additions and 9 deletions
|
|
@ -179,20 +179,14 @@ module.exports.BatchUpdate = BatchUpdate = (model) ->
|
||||||
user: user
|
user: user
|
||||||
|
|
||||||
obj: ->
|
obj: ->
|
||||||
obj ?= model.get('users.'+user.get('id'), true)
|
obj ?= model.get 'users.'+user.get('id')
|
||||||
return obj
|
return obj
|
||||||
|
|
||||||
startTransaction: ->
|
startTransaction: ->
|
||||||
# start a batch transaction - nothing between now and @commit() will be set immediately
|
# start a batch transaction - nothing between now and @commit() will be set immediately
|
||||||
transactionInProgress = true
|
transactionInProgress = true
|
||||||
model._dontPersist = true
|
model._dontPersist = true
|
||||||
|
@obj()
|
||||||
# Really strange, user.get() seems to only return attributes which have previously been accessed. So in
|
|
||||||
# many cases, userObj.tasks.{taskId}.value is undefined - so we manually .get() each attribute here.
|
|
||||||
# Additionally, for some reason after getting the user object, changing properies manually (userObj.stats.hp = 50)
|
|
||||||
# seems to actually run user.set('stats.hp',50) which we don't want to do - so we deepClone here
|
|
||||||
#_.each Object.keys(userSchema), (key) -> obj[key] = lodash.cloneDeep user.get(key)
|
|
||||||
obj = @obj()
|
|
||||||
|
|
||||||
###
|
###
|
||||||
Handles updating the user model. If this is an en-mass operation (eg, server cron), changes are queued
|
Handles updating the user model. If this is an en-mass operation (eg, server cron), changes are queued
|
||||||
|
|
|
||||||
|
|
@ -260,7 +260,7 @@ cron = () ->
|
||||||
batch.setStats()
|
batch.setStats()
|
||||||
batch.set('history', obj.history)
|
batch.set('history', obj.history)
|
||||||
batch.commit()
|
batch.commit()
|
||||||
#browser.resetDom(model)
|
browser.resetDom(model)
|
||||||
setTimeout (-> user.set 'stats.hp', hpAfter), 1000 # animate hp loss
|
setTimeout (-> user.set 'stats.hp', hpAfter), 1000 # animate hp loss
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue