-
Notifications
You must be signed in to change notification settings - Fork 149
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: problem with endless loading of balances and names #5296
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,8 @@ import { useGetBitcoinBalanceByAddress } from './btc-balance.hooks'; | |
|
||
// Balance is derived from a single query in address reuse mode | ||
export function useNativeSegwitBalance(address: string) { | ||
const { balance, isInitialLoading, isLoading } = useGetBitcoinBalanceByAddress(address); | ||
const { balance, isInitialLoading, isLoading, isFetching } = | ||
useGetBitcoinBalanceByAddress(address); | ||
|
||
const wrappedBalance = useMemo( | ||
() => createBitcoinCryptoCurrencyAssetTypeWrapper(balance), | ||
|
@@ -18,6 +19,7 @@ export function useNativeSegwitBalance(address: string) { | |
btcBalance: wrappedBalance, | ||
isInitialLoading, | ||
isLoading, | ||
isFetching, | ||
}; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one could also be a single query being returned with a select There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it couldn't... actually not that easy. the query |
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only need one of these two techniques right? select or replacing data?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
problem here is again in ledger mode, when query is not enabled, select doesn't work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but if you do it on the data prop, it works for both cases, and the select isn't needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you mean remove select and
data: (query.data?.names ?? [])[0] || getAutogeneratedAccountDisplayName(index)
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It just seems strange to me you're repeating the logic twice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can try it in ledger bitcoin only mode