Fix more button shown after logs deleted

This commit is contained in:
ekzyis 2024-10-23 19:03:41 +02:00
parent d9e9a6722a
commit 58c37bbd63
1 changed files with 5 additions and 0 deletions

View File

@ -254,5 +254,10 @@ export function useWalletLogs (wallet, initialPage = 1, logsPerPage = 10) {
loadLogs()
}, [wallet?.def])
useEffect(() => {
// make sure 'more' button is removed if logs are deleted
if (logs.length === 0) setHasMore(false)
}, [logs?.length])
return { logs, hasMore, total, loadMore, loadLogs, setLogs, loading }
}