Compare commits

..

No commits in common. "d6caee5b4235bc5c8d64e659572e17d49e7dbbfd" and "d9e9a6722a8db9bbd0d133bbc980098d5089058f" have entirely different histories.

View File

@ -173,7 +173,7 @@ function tag (walletDef) {
}
export function useWalletLogs (wallet, initialPage = 1, logsPerPage = 10) {
const [logs, _setLogs] = useState([])
const [logs, setLogs] = useState([])
const [page, setPage] = useState(initialPage)
const [hasMore, setHasMore] = useState(true)
const [total, setTotal] = useState(0)
@ -183,14 +183,6 @@ export function useWalletLogs (wallet, initialPage = 1, logsPerPage = 10) {
const { getPage, error, notSupported } = useWalletLogDB()
const [getWalletLogs] = useLazyQuery(WALLET_LOGS, SSR ? {} : { fetchPolicy: 'cache-and-network' })
const setLogs = useCallback((action) => {
_setLogs(action)
// action can be a React state dispatch function
const newLogs = typeof action === 'function' ? action(logs) : action
// make sure 'more' button is removed if logs were deleted
if (newLogs.length === 0) setHasMore(false)
}, [logs, _setLogs, setHasMore])
const loadLogsPage = useCallback(async (page, pageSize, walletDef) => {
try {
let result = { data: [], hasMore: false }