Fix infinite loop of loading wallet logs
This commit is contained in:
parent
1d3ab23ec4
commit
d91c5c90de
|
@ -12,10 +12,7 @@ import useIndexedDB from './use-indexeddb'
|
|||
import { SSR } from '@/lib/constants'
|
||||
|
||||
export function WalletLogs ({ wallet, embedded }) {
|
||||
const { logs, setLogs, hasMore, loadMore, loadLogs, loading } = useWalletLogs(wallet)
|
||||
useEffect(() => {
|
||||
loadLogs()
|
||||
}, [loadLogs])
|
||||
const { logs, setLogs, hasMore, loadMore, loading } = useWalletLogs(wallet)
|
||||
|
||||
const showModal = useShowModal()
|
||||
|
||||
|
@ -247,5 +244,9 @@ export function useWalletLogs (wallet, initialPage = 1, logsPerPage = 10) {
|
|||
setLoading(false)
|
||||
}, [wallet, loadLogsPage])
|
||||
|
||||
useEffect(() => {
|
||||
loadLogs()
|
||||
}, [wallet])
|
||||
|
||||
return { logs, hasMore, total, loadMore, loadLogs, setLogs, loading }
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue