Compare commits
No commits in common. "153f47de7d13348ccf16c3ee5fdd45da350d14cb" and "aba212f6ec0f353f74c75da326cefa7554b2819c" have entirely different histories.
153f47de7d
...
aba212f6ec
@ -131,7 +131,7 @@ export const getBlockHeight = cachedFetcher(async function fetchBlockHeight ({ l
|
|||||||
|
|
||||||
export const getOurPubkey = cachedFetcher(async function fetchOurPubkey ({ lnd, ...args }) {
|
export const getOurPubkey = cachedFetcher(async function fetchOurPubkey ({ lnd, ...args }) {
|
||||||
try {
|
try {
|
||||||
const identity = await getIdentity({ lnd, ...args })
|
const { identity } = await getIdentity({ lnd, ...args })
|
||||||
return identity.public_key
|
return identity.public_key
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
throw new Error(`Unable to fetch identity: ${err.message}`)
|
throw new Error(`Unable to fetch identity: ${err.message}`)
|
||||||
|
@ -12,7 +12,10 @@ import useIndexedDB from './use-indexeddb'
|
|||||||
import { SSR } from '@/lib/constants'
|
import { SSR } from '@/lib/constants'
|
||||||
|
|
||||||
export function WalletLogs ({ wallet, embedded }) {
|
export function WalletLogs ({ wallet, embedded }) {
|
||||||
const { logs, setLogs, hasMore, loadMore, loading } = useWalletLogs(wallet)
|
const { logs, setLogs, hasMore, loadMore, loadLogs, loading } = useWalletLogs(wallet)
|
||||||
|
useEffect(() => {
|
||||||
|
loadLogs()
|
||||||
|
}, [loadLogs])
|
||||||
|
|
||||||
const showModal = useShowModal()
|
const showModal = useShowModal()
|
||||||
|
|
||||||
@ -43,7 +46,7 @@ export function WalletLogs ({ wallet, embedded }) {
|
|||||||
? <div className='w-100 text-center'>loading...</div>
|
? <div className='w-100 text-center'>loading...</div>
|
||||||
: logs.length === 0 && <div className='w-100 text-center'>empty</div>}
|
: logs.length === 0 && <div className='w-100 text-center'>empty</div>}
|
||||||
{hasMore
|
{hasMore
|
||||||
? <div className='w-100 text-center'><Button onClick={loadMore} size='sm' className='mt-3'>more</Button></div>
|
? <Button onClick={loadMore} size='sm' className='mt-3'>Load More</Button>
|
||||||
: <div className='w-100 text-center'>------ start of logs ------</div>}
|
: <div className='w-100 text-center'>------ start of logs ------</div>}
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
@ -244,9 +247,5 @@ export function useWalletLogs (wallet, initialPage = 1, logsPerPage = 10) {
|
|||||||
setLoading(false)
|
setLoading(false)
|
||||||
}, [wallet, loadLogsPage])
|
}, [wallet, loadLogsPage])
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
loadLogs()
|
|
||||||
}, [wallet])
|
|
||||||
|
|
||||||
return { logs, hasMore, total, loadMore, loadLogs, setLogs, loading }
|
return { logs, hasMore, total, loadMore, loadLogs, setLogs, loading }
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user