don't ever reveal user wallet balances to other users

This commit is contained in:
keyan 2021-12-30 16:02:18 -06:00
parent 468c054d45
commit 01ee9cdd1c
2 changed files with 5 additions and 2 deletions

View File

@ -150,7 +150,10 @@ export default {
AND "Item"."userId" = ${user.id}` AND "Item"."userId" = ${user.id}`
return sum || 0 return sum || 0
}, },
sats: async (user, args, { models }) => { sats: async (user, args, { models, me }) => {
if (me?.id !== user.id) {
return 0
}
return Math.floor(user.msats / 1000) return Math.floor(user.msats / 1000)
}, },
bio: async (user, args, { models }) => { bio: async (user, args, { models }) => {

View File

@ -33,7 +33,7 @@ export default function Seo ({ item, user }) {
} }
} }
if (user) { if (user) {
desc = `@${user.name} has [${user.stacked} stacked, ${user.sats} sats, ${user.nitems} posts, ${user.ncomments} comments]` desc = `@${user.name} has [${user.stacked} stacked, ${user.nitems} posts, ${user.ncomments} comments]`
} }
return ( return (