Skip to content

Commit

Permalink
hotfix: if stacked and spent are 0, don't show/push notification
Browse files Browse the repository at this point in the history
  • Loading branch information
Soxasora committed Dec 23, 2024
1 parent fb61520 commit 82553a2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions api/resolvers/notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ export default {
AND t >= date_trunc('day', CURRENT_DATE - INTERVAL '2 day')
AND t <= $2
GROUP BY t
HAVING sum(msats_stacked) != 0 OR sum(msats_spent) != 0
ORDER BY "sortTime" DESC
LIMIT 1)`
)
Expand Down
2 changes: 2 additions & 0 deletions worker/satSummary.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ export async function summarizeDailySats ({ data: { userId }, models }) {
WHERE id = ${userId}
AND t >= date_trunc('day', CURRENT_DATE - INTERVAL '1 day')
AND t <= date_trunc('day', CURRENT_DATE)
GROUP BY id
HAVING sum(msats_stacked) != 0 OR sum(msats_spent) != 0
LIMIT 1
`

Expand Down

0 comments on commit 82553a2

Please sign in to comment.