Skip to content

Commit

Permalink
Merge branch 'master' into daily_sats_summary_notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
Soxasora authored Jan 11, 2025
2 parents a789e7d + 7daf688 commit f832aff
Show file tree
Hide file tree
Showing 11 changed files with 864 additions and 141 deletions.
12 changes: 11 additions & 1 deletion api/paidAction/zap.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,17 @@ export async function nonCriticalSideEffects ({ invoice, actIds }, { models }) {
where: invoice ? { invoiceId: invoice.id } : { id: { in: actIds } },
include: { item: true }
})
notifyZapped({ models, item: itemAct.item }).catch(console.error)
// avoid duplicate notifications with the same zap amount
// by checking if there are any other pending acts on the item
const pendingActs = await models.itemAct.count({
where: {
itemId: itemAct.itemId,
createdAt: {
gt: itemAct.createdAt
}
}
})
if (pendingActs === 0) notifyZapped({ models, item: itemAct.item }).catch(console.error)
}

export async function onFail ({ invoice }, { tx }) {
Expand Down
20 changes: 0 additions & 20 deletions api/resolvers/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -441,26 +441,6 @@ export default {
}

if (user.noteWithdrawals) {
const p2pZap = await models.invoice.findFirst({
where: {
confirmedAt: {
gt: lastChecked
},
invoiceForward: {
withdrawl: {
userId: me.id,
status: 'CONFIRMED',
updatedAt: {
gt: lastChecked
}
}
}
}
})
if (p2pZap) {
foundNotes()
return true
}
const wdrwl = await models.withdrawl.findFirst({
where: {
userId: me.id,
Expand Down
2 changes: 1 addition & 1 deletion components/badge.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export function BadgeTooltip ({ children, overlayText, placement }) {
<OverlayTrigger
placement={placement || 'bottom'}
overlay={
<Tooltip>
<Tooltip style={{ position: 'fixed' }}>
{overlayText}
</Tooltip>
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit f832aff

Please sign in to comment.