Skip to content

Commit

Permalink
fix #1795
Browse files Browse the repository at this point in the history
  • Loading branch information
huumn committed Jan 5, 2025
1 parent a04647d commit 529b5d1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions api/resolvers/item.js
Original file line number Diff line number Diff line change
Expand Up @@ -1053,10 +1053,16 @@ export default {
}
},
Item: {
sats: async (item, args, { models }) => {
sats: async (item, args, { models, me }) => {
if (me?.id === item.userId) {
return msatsToSats(BigInt(item.msats))
}
return msatsToSats(BigInt(item.msats) + BigInt(item.mePendingMsats || 0) + BigInt(item.mePendingMcredits || 0))
},
credits: async (item, args, { models }) => {
credits: async (item, args, { models, me }) => {
if (me?.id === item.userId) {
return msatsToSats(BigInt(item.mcredits))
}
return msatsToSats(BigInt(item.mcredits) + BigInt(item.mePendingMcredits || 0))
},
commentSats: async (item, args, { models }) => {
Expand Down

0 comments on commit 529b5d1

Please sign in to comment.