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

View File

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