Also strike on payment after short press

This commit is contained in:
ekzyis 2023-07-23 02:24:03 +02:00
parent d186e869e1
commit ba04e6522d
1 changed files with 3 additions and 1 deletions

View File

@ -11,7 +11,7 @@ import LongPressable from 'react-longpressable'
import Overlay from 'react-bootstrap/Overlay'
import Popover from 'react-bootstrap/Popover'
import { useShowModal } from './modal'
import { LightningConsumer } from './lightning'
import { LightningConsumer, useLightning } from './lightning'
import { isInsufficientFundsError } from '../lib/anonymous'
const getColor = (meSats) => {
@ -71,6 +71,7 @@ export default function UpVote ({ item, className, pendingSats, setPendingSats }
const ref = useRef()
const timerRef = useRef(null)
const me = useMe()
const strike = useLightning()
const [setWalkthrough] = useMutation(
gql`
mutation setWalkthrough($upvotePopover: Boolean, $tipPopover: Boolean) {
@ -184,6 +185,7 @@ export default function UpVote ({ item, className, pendingSats, setPendingSats }
amount={pendingSats}
onPayment={async (_, invoiceHash) => {
await act({ variables: { ...variables, invoiceHash } })
strike()
}}
/>
)