Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix global wallet logs never fetch logs from server #1535

Merged
merged 1 commit into from
Nov 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions components/wallet-logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,14 +201,14 @@ export function useWalletLogs (wallet, initialPage = 1, logsPerPage = 10) {
const query = walletDef ? window.IDBKeyRange.bound([tag(walletDef), -Infinity], [tag(walletDef), Infinity]) : null

result = await getPage(page, pageSize, indexName, query, 'prev')
// no walletType means we're using the local IDB
if (!walletDef?.walletType) {
// if given wallet has no walletType it means logs are only stored in local IDB
if (walletDef && !walletDef.walletType) {
return result
}
}
const { data } = await getWalletLogs({
variables: {
type: walletDef.walletType,
type: walletDef?.walletType,
// if it client logs has more, page based on it's range
from: result?.data[result.data.length - 1]?.ts && result.hasMore ? String(result.data[result.data.length - 1].ts) : null,
// if we have a cursor (this isn't the first page), page based on it's range
Expand Down
Loading