Skip to content

Commit

Permalink
Fix NaN on zap
Browse files Browse the repository at this point in the history
Third argument of update is reserved for context
  • Loading branch information
ekzyis committed Jan 20, 2024
1 parent ae19e53 commit 7543e08
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion components/invoice.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ export const useInvoiceable = (onSubmit, options = defaultOptions) => {
provider,
pollInvoice,
updateCache: () => update?.(client.cache, { data: optimisticResponse }),
undoUpdate: () => update?.(client.cache, { data: optimisticResponse }, true)
undoUpdate: () => update?.(client.cache, { data: { ...optimisticResponse, undo: true } })
})
const { webLN, modalClose } = payment

Expand Down
4 changes: 2 additions & 2 deletions components/item-act.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ export function useAct ({ onUpdate } = {}) {
}

export function useZap () {
const update = useCallback((cache, args, undo) => {
const { data: { act: { id, sats, path, amount } } } = args
const update = useCallback((cache, args) => {
const { data: { act: { id, sats, path, amount, undo } } } = args

// determine how much we increased existing sats by by checking the
// difference between result sats and meSats
Expand Down

0 comments on commit 7543e08

Please sign in to comment.