Compare commits

..

No commits in common. "5cfefc1ca84a95c434c4b441793f11652de8ef35" and "467a9d6a762d43115c4309dc36b5964829d97f57" have entirely different histories.

4 changed files with 10 additions and 20 deletions

View File

@ -87,15 +87,15 @@ const SocialsPopover = (
const ChatPopover = (
<Popover>
<Popover.Body style={{ fontWeight: 500, fontSize: '.9rem' }}>
{/* <a
<a
href='https://tribes.sphinx.chat/t/stackerzchat' className='nav-link p-0 d-inline-flex'
target='_blank' rel='noreferrer'
>
sphinx
</a>
<span className='mx-2 text-muted'> \ </span> */}
<span className='mx-2 text-muted'> \ </span>
<a
href='https://t.me/k00bideh' className='nav-link p-0 d-inline-flex'
href='https://t.me/stackernews' className='nav-link p-0 d-inline-flex'
target='_blank' rel='noreferrer'
>
telegram

View File

@ -1,6 +1,6 @@
import { useApolloClient, useLazyQuery, useMutation } from '@apollo/client'
import { useCallback, useState } from 'react'
import { InvoiceCanceledError, InvoiceExpiredError, useInvoice, useQrPayment, useWalletPayment } from './payment'
import { InvoiceCanceledError, InvoiceExpiredError, useQrPayment, useWalletPayment } from './payment'
import { GET_PAID_ACTION } from '@/fragments/paidAction'
/*
@ -23,7 +23,6 @@ export function usePaidMutation (mutation,
fetchPolicy: 'network-only'
})
const waitForWalletPayment = useWalletPayment()
const invoiceHelper = useInvoice()
const waitForQrPayment = useQrPayment()
const client = useApolloClient()
// innerResult is used to store/control the result of the mutation when innerMutate runs
@ -41,14 +40,12 @@ export function usePaidMutation (mutation,
err instanceof InvoiceExpiredError) {
// bail since qr code payment will also fail
// also bail if the payment took more than 1 second
// and cancel the invoice if it's not already canceled so it can be retried
invoiceHelper.cancel(invoice).catch(console.error)
throw err
}
walletError = err
}
return await waitForQrPayment(invoice, walletError, { persistOnNavigate, waitFor })
}, [waitForWalletPayment, waitForQrPayment, invoiceHelper])
}, [waitForWalletPayment, waitForQrPayment])
const innerMutate = useCallback(async ({
onCompleted: innerOnCompleted, ...innerOptions

View File

@ -40,7 +40,6 @@ export const COMMENT_FIELDS = gql`
actionState
confirmedAt
}
cost
}
`

View File

@ -186,23 +186,20 @@ function useConfig (wallet) {
let valid = true
try {
const transformedConfig = await walletValidate(wallet, newClientConfig)
if (transformedConfig) {
newClientConfig = Object.assign(newClientConfig, transformedConfig)
}
newClientConfig = await walletValidate(wallet, newClientConfig)
} catch {
valid = false
}
if (valid) {
if (priorityOnly) {
setClientConfig(newClientConfig)
setClientConfig(newConfig)
} else {
try {
// XXX: testSendPayment can return a new config (e.g. lnc)
// XXX: testSendPayment can return a new config (e.g. lnc)
const newerConfig = await wallet.testSendPayment?.(newConfig, { me, logger })
if (newerConfig) {
newClientConfig = Object.assign(newClientConfig, newerConfig)
newClientConfig = newerConfig
}
} catch (err) {
logger.error(err.message)
@ -222,10 +219,7 @@ function useConfig (wallet) {
let valid = true
try {
const transformedConfig = await walletValidate(wallet, newServerConfig)
if (transformedConfig) {
newServerConfig = Object.assign(newServerConfig, transformedConfig)
}
newServerConfig = await walletValidate(wallet, newServerConfig)
} catch {
valid = false
}