aboutsummaryrefslogtreecommitdiffstats
path: root/index.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2019-01-02 18:04:41 +0000
committerAdam Soltys <[email protected]>2019-02-05 20:53:45 -0800
commit498fd370b536eacc08505ed4b4ac2b3360a46ea4 (patch)
tree5ff79735b0ece72e734a3350ef894e02d8562145 /index.js
parent3d1817b8bb9f74d8005d5b544682c130145bf204 (diff)
downloadcoinos-server-498fd370b536eacc08505ed4b4ac2b3360a46ea4.tar.gz
coinos-server-498fd370b536eacc08505ed4b4ac2b3360a46ea4.zip
emit user after block
Diffstat (limited to 'index.js')
-rw-r--r--index.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/index.js b/index.js
index 3f413855..15beede5 100644
--- a/index.js
+++ b/index.js
@@ -225,10 +225,11 @@ const l = console.log
[Sequelize.Op.ne]: 0,
}
},
- }).map(async u => {
- u.balance = u.pending
- u.pending = 0
- await u.save()
+ }).map(async user => {
+ user.balance += user.pending
+ user.pending = 0
+ await user.save()
+ socket.to(sids[user.username]).emit('user', user)
})
await db.Payment.update({