add hasSendWallet to bounty pay (#1806)

This commit is contained in:
Riccardo Balbo 2025-01-05 18:26:18 +01:00 committed by GitHub
parent 95950cdff8
commit 0750a7b197
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -9,6 +9,7 @@ import { useRoot } from './root'
import { ActCanceledError, useAct } from './item-act' import { ActCanceledError, useAct } from './item-act'
import { useLightning } from './lightning' import { useLightning } from './lightning'
import { useToast } from './toast' import { useToast } from './toast'
import { useSendWallets } from '@/wallets/index'
export const payBountyCacheMods = { export const payBountyCacheMods = {
onPaid: (cache, { data }) => { onPaid: (cache, { data }) => {
@ -49,7 +50,9 @@ export default function PayBounty ({ children, item }) {
const root = useRoot() const root = useRoot()
const strike = useLightning() const strike = useLightning()
const toaster = useToast() const toaster = useToast()
const variables = { id: item.id, sats: root.bounty, act: 'TIP' } const wallets = useSendWallets()
const variables = { id: item.id, sats: root.bounty, act: 'TIP', hasSendWallet: wallets.length > 0 }
const act = useAct({ const act = useAct({
variables, variables,
optimisticResponse: { act: { __typename: 'ItemActPaidAction', result: { ...variables, path: item.path } } }, optimisticResponse: { act: { __typename: 'ItemActPaidAction', result: { ...variables, path: item.path } } },