mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-07-16 03:02:24 +00:00
check @session.req?
This commit is contained in:
parent
1fa00fb658
commit
ebca9fe1b7
1 changed files with 1 additions and 1 deletions
|
|
@ -38,7 +38,7 @@ userAccess = (store) ->
|
|||
|
||||
store.writeAccess "*", "users.*.balance", (id, newBalance, accept, err) ->
|
||||
return accept(true) unless @session?.userId # https://github.com/codeparty/racer/issues/37
|
||||
oldBalance = @session.req._racerModel?.get("users.#{id}.balance") || 0
|
||||
oldBalance = @session.req?._racerModel?.get("users.#{id}.balance") || 0
|
||||
purchasingSomethingOnClient = newBalance < oldBalance
|
||||
accept(purchasingSomethingOnClient or @session.req?._isServer)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue