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: ledger bitcoin query #5571

Merged
merged 1 commit into from
Jun 26, 2024
Merged

fix: ledger bitcoin query #5571

merged 1 commit into from
Jun 26, 2024

Conversation

fbwoolf
Copy link
Contributor

@fbwoolf fbwoolf commented Jun 25, 2024

The bug here took a bit to track down, but it was a change made to use the btc balance to disable the home page send button.

Hoping to install this change to the query pkg before merging this: leather-io/mono#236

Summary by CodeRabbit

  • Refactor
    • Standardized variable names for loading states across various components to isLoading for consistency.
    • Simplified conditional logic in CurrentStacksAccountLoader component.
    • Updated implementation to remove unnecessary dependencies in SendButtonSuspense component.
    • Improved code readability by restructuring return objects and modifying import statements.

These changes enhance code clarity and consistency, ensuring a more maintainable codebase and uniform loading state handling across the application.

Copy link

coderabbitai bot commented Jun 25, 2024

Walkthrough

The recent updates primarily involve standardizing variable names for isLoading across multiple components and hooks related to fetching balances and statuses for Stacks (STX) and Bitcoin (BTC). This enhancement improves code clarity and consistency. Additionally, some minor adjustments and refactoring were implemented to streamline the logic and improve code readability within various components.

Changes

File Change Summary
src/app/common/hooks/balance/use-total-balance.tsx Updated variable names related to STX and BTC balances for clarity (e.g., isFetchingStacksBalance, isLoadingStxBalance).
src/app/components/loaders/btc-balance-loader.tsx Changed isInitialLoading to isLoading in BtcBalanceLoader and BtcAssetItemBalanceLoader components.
src/app/components/loaders/sip10-tokens-loader.tsx Renamed isInitialLoading to isLoading within Sip10TokensLoader function.
src/app/components/loaders/stacks-account-loader.tsx Simplified the return statement within CurrentStacksAccountLoader function.
src/app/components/loaders/stx-balance-loader.tsx Changed isInitialLoading to isLoading in StxAssetItemBalanceLoader component.
src/app/features/activity-list/activity-list.tsx Renamed isInitialLoading flags to isLoading for BTC and STX transactions.
src/app/features/asset-list/asset-list.tsx Renamed isInitialLoading to isLoading for various crypto asset loading states.
src/app/features/asset-list/…/brc20-token-asset-list/brc20-token-asset-list.tsx Updated isLoading property from result.isInitialLoading to isLoading in Brc20TokenAssetList function.
src/app/pages/fund/choose-asset-to-fund/choose-asset-to-fund.tsx Renamed isInitialLoading to isLoading for loading state representation in ChooseCryptoAssetToFund function.
src/app/pages/home/components/send-button.tsx Adjusted isDisabled flag calculation in SendButtonSuspense by removing dependency on btcBalance.
src/app/pages/home/home.tsx Added useCurrentAccountIndex import and updated variable currentAccountIndex usage in useAccountDisplayName function.
src/app/query/bitcoin/balance/btc-balance-native-segwit.hooks.ts Restructured the return object in useBtcCryptoAssetBalanceNativeSegwit by spreading query object and adjusting the balance return structure.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@fbwoolf fbwoolf requested review from kyranjamie and alter-eggo June 25, 2024 01:51
import { useCurrentAccountNativeSegwitIndexZeroSignerNullable } from '@app/store/accounts/blockchain/bitcoin/native-segwit-account.hooks';
import { useCurrentStacksAccountAddress } from '@app/store/accounts/blockchain/stacks/stacks-account.hooks';

function SendButtonSuspense() {
const navigate = useNavigate();
const { whenWallet } = useWalletType();
const btcAddress = useCurrentAccountNativeSegwitIndexZeroSignerNullable()?.address;
const { balance: btcBalance } = useBtcCryptoAssetBalanceNativeSegwit(btcAddress ?? '');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was the bug in the linked issue.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between d3595f4 and ae62780.

Files selected for processing (9)
  • src/app/components/loaders/bitcoin-account-loader.tsx (1 hunks)
  • src/app/components/loaders/btc-balance-loader.tsx (1 hunks)
  • src/app/components/loaders/sip10-tokens-loader.tsx (1 hunks)
  • src/app/components/loaders/stx-balance-loader.tsx (2 hunks)
  • src/app/features/activity-list/activity-list.tsx (4 hunks)
  • src/app/features/asset-list/asset-list.tsx (4 hunks)
  • src/app/features/asset-list/bitcoin/brc20-token-asset-list/brc20-token-asset-list.tsx (1 hunks)
  • src/app/pages/fund/choose-asset-to-fund/choose-asset-to-fund.tsx (2 hunks)
  • src/app/pages/home/components/send-button.tsx (1 hunks)
Files skipped from review due to trivial changes (1)
  • src/app/pages/fund/choose-asset-to-fund/choose-asset-to-fund.tsx
Additional context used
GitHub Check: typecheck
src/app/components/loaders/sip10-tokens-loader.tsx

[failure] 13-13:
Property 'isLoading' does not exist on type '{ isInitialLoading: boolean; tokens: { balance: CryptoAssetBalance; info: Sip10CryptoAssetInfo; }[]; }'.

Additional comments not posted (7)
src/app/components/loaders/btc-balance-loader.tsx (1)

12-12: Good alignment with new naming convention.

The change from isInitialLoading to isLoading in both the interface and the function implementation is consistent and aligns with the new naming convention.

Also applies to: 19-19

src/app/components/loaders/stx-balance-loader.tsx (1)

15-15: Good alignment with new naming convention.

The change from isInitialLoading to isLoading in both the interface and the function implementation is consistent and aligns with the new naming convention.

Also applies to: 31-32

src/app/components/loaders/bitcoin-account-loader.tsx (1)

36-36: Improved fallback handling.

The explicit handling of the fallback condition enhances robustness by ensuring a null return when fallback is falsy.

src/app/pages/home/components/send-button.tsx (1)

25-25: Aligns with PR objectives to simplify button disabling logic.

Removing the dependency on btcBalance for disabling the send button simplifies the logic and aligns with the PR objectives.

src/app/features/asset-list/bitcoin/brc20-token-asset-list/brc20-token-asset-list.tsx (1)

52-52: Renaming of loading state variable approved.

The change from isInitialLoading to isLoading is consistent with the PR’s aim to standardize loading state naming conventions across the codebase.

src/app/features/activity-list/activity-list.tsx (1)

Line range hint 53-79: Renaming of loading state variables approved.

The systematic replacement of isInitialLoading with isLoading across various hooks and conditional checks in ActivityList enhances clarity and maintains consistency with the rest of the codebase.

src/app/features/asset-list/asset-list.tsx (1)

Line range hint 58-153: Renaming of loading state variables approved across various loaders.

The systematic replacement of isInitialLoading with isLoading in various loaders within AssetList enhances clarity and maintains consistency with the rest of the codebase.
[APROVED]

@@ -10,6 +10,6 @@
children(isLoading: boolean, tokens: Sip10TokenAssetDetails[]): React.ReactNode;
}
export function Sip10TokensLoader({ address, filter, children }: Sip10TokensLoaderProps) {
const { isInitialLoading, tokens = [] } = useFilteredSip10Tokens({ address, filter });
return children(isInitialLoading, tokens);
const { isLoading, tokens = [] } = useFilteredSip10Tokens({ address, filter });
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type mismatch needs correction.

The isLoading property does not exist on the returned object from useFilteredSip10Tokens. This needs to be corrected to align with expected property names.

-  const { isLoading, tokens = [] } = useFilteredSip10Tokens({ address, filter });
+  const { isInitialLoading: isLoading, tokens = [] } = useFilteredSip10Tokens({ address, filter });
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const { isLoading, tokens = [] } = useFilteredSip10Tokens({ address, filter });
const { isInitialLoading: isLoading, tokens = [] } = useFilteredSip10Tokens({ address, filter });
Tools
GitHub Check: typecheck

[failure] 13-13:
Property 'isLoading' does not exist on type '{ isInitialLoading: boolean; tokens: { balance: CryptoAssetBalance; info: Sip10CryptoAssetInfo; }[]; }'.

@kyranjamie
Copy link
Collaborator

kyranjamie commented Jun 25, 2024

Is there a test we can write for this too?

@fbwoolf fbwoolf force-pushed the fix/ledger-bitcoin-query branch 2 times, most recently from 5be65b9 to da558d8 Compare June 25, 2024 15:00
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between ae62780 and da558d8.

Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
Files selected for processing (10)
  • package.json (1 hunks)
  • src/app/components/loaders/btc-balance-loader.tsx (1 hunks)
  • src/app/components/loaders/sip10-tokens-loader.tsx (1 hunks)
  • src/app/components/loaders/stacks-account-loader.tsx (1 hunks)
  • src/app/components/loaders/stx-balance-loader.tsx (2 hunks)
  • src/app/features/activity-list/activity-list.tsx (4 hunks)
  • src/app/features/asset-list/asset-list.tsx (4 hunks)
  • src/app/features/asset-list/bitcoin/brc20-token-asset-list/brc20-token-asset-list.tsx (1 hunks)
  • src/app/pages/fund/choose-asset-to-fund/choose-asset-to-fund.tsx (2 hunks)
  • src/app/pages/home/components/send-button.tsx (1 hunks)
Files skipped from review due to trivial changes (2)
  • package.json
  • src/app/components/loaders/stacks-account-loader.tsx
Files skipped from review as they are similar to previous changes (7)
  • src/app/components/loaders/sip10-tokens-loader.tsx
  • src/app/components/loaders/stx-balance-loader.tsx
  • src/app/features/activity-list/activity-list.tsx
  • src/app/features/asset-list/asset-list.tsx
  • src/app/features/asset-list/bitcoin/brc20-token-asset-list/brc20-token-asset-list.tsx
  • src/app/pages/fund/choose-asset-to-fund/choose-asset-to-fund.tsx
  • src/app/pages/home/components/send-button.tsx
Additional context used
GitHub Check: typecheck
src/app/components/loaders/btc-balance-loader.tsx

[failure] 16-16:
Argument of type '{ isLoading: boolean; data: UtxoResponseItem[]; error: Error; isError: true; isPending: false; isLoadingError: false; isRefetchError: true; isSuccess: false; status: "error"; ... 14 more ...; fetchStatus: FetchStatus; } | { ...; } | { ...; } | { ...; } | { ...; }' is not assignable to parameter of type 'UseQueryResult<UtxoResponseItem[] | undefined, Error | null>'.


[failure] 17-17:
Argument of type '{ isLoading: boolean; data: UtxoResponseItem[]; error: Error; isError: true; isPending: false; isLoadingError: false; isRefetchError: true; isSuccess: false; status: "error"; ... 14 more ...; fetchStatus: FetchStatus; } | { ...; } | { ...; } | { ...; } | { ...; }' is not assignable to parameter of type 'UseQueryResult<UtxoResponseItem[] | undefined, Error | null>'.

Additional comments not posted (1)
src/app/components/loaders/btc-balance-loader.tsx (1)

12-12: Approve parameter renaming for consistency.

Renaming isInitialLoading to isLoading in the function signature enhances consistency across the application, aligning with similar changes in other components.

}
export function BtcBalanceLoader({ address, children }: BtcBalanceLoaderProps) {
const { balance, query: result } = useBtcCryptoAssetBalanceNativeSegwit(address);
if (isInitializingData(result)) return <CryptoAssetItemPlaceholder />;
if (!isFetchedWithSuccess(result))
return <CryptoAssetItemError caption="BTC" icon={<BtcAvatarIcon />} title="Bitcoin" />;
return children(balance, result.isInitialLoading);
return children(balance, result.isLoading);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix type mismatches in the return statement.

There seems to be a type error in the way result.isLoading is being used. Ensure that the types align correctly with the expected types in the children function call.

- return children(balance, result.isLoading);
+ return children(balance, result.isLoading as boolean); // Assuming `isLoading` should indeed be a boolean, cast it explicitly if necessary.
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
return children(balance, result.isLoading);
return children(balance, result.isLoading as boolean); // Assuming `isLoading` should indeed be a boolean, cast it explicitly if necessary.

@fbwoolf fbwoolf force-pushed the fix/ledger-bitcoin-query branch from da558d8 to 640e400 Compare June 25, 2024 21:48
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between da558d8 and 640e400.

Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
Files selected for processing (12)
  • package.json (1 hunks)
  • src/app/common/hooks/balance/use-total-balance.tsx (2 hunks)
  • src/app/components/loaders/btc-balance-loader.tsx (2 hunks)
  • src/app/components/loaders/sip10-tokens-loader.tsx (1 hunks)
  • src/app/components/loaders/stacks-account-loader.tsx (1 hunks)
  • src/app/components/loaders/stx-balance-loader.tsx (2 hunks)
  • src/app/features/activity-list/activity-list.tsx (4 hunks)
  • src/app/features/asset-list/asset-list.tsx (4 hunks)
  • src/app/features/asset-list/bitcoin/brc20-token-asset-list/brc20-token-asset-list.tsx (2 hunks)
  • src/app/pages/fund/choose-asset-to-fund/choose-asset-to-fund.tsx (2 hunks)
  • src/app/pages/home/components/send-button.tsx (1 hunks)
  • src/app/query/bitcoin/balance/btc-balance-native-segwit.hooks.ts (1 hunks)
Files skipped from review due to trivial changes (1)
  • src/app/common/hooks/balance/use-total-balance.tsx
Files skipped from review as they are similar to previous changes (10)
  • package.json
  • src/app/components/loaders/btc-balance-loader.tsx
  • src/app/components/loaders/sip10-tokens-loader.tsx
  • src/app/components/loaders/stacks-account-loader.tsx
  • src/app/components/loaders/stx-balance-loader.tsx
  • src/app/features/activity-list/activity-list.tsx
  • src/app/features/asset-list/asset-list.tsx
  • src/app/features/asset-list/bitcoin/brc20-token-asset-list/brc20-token-asset-list.tsx
  • src/app/pages/fund/choose-asset-to-fund/choose-asset-to-fund.tsx
  • src/app/pages/home/components/send-button.tsx
Additional comments not posted (1)
src/app/query/bitcoin/balance/btc-balance-native-segwit.hooks.ts (1)

39-39: Refactoring of the return statement for clarity and maintainability.

The restructuring of the return statement to spread the query object before appending the balance ensures that all properties of query are directly accessible, enhancing maintainability and reducing the need for additional property accesses.

Comment on lines 41 to 43
};
}

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding error handling for nativeSegwitSigner.

The function directly uses nativeSegwitSigner.address without null checks. Adding error handling or null checks can prevent runtime errors if nativeSegwitSigner is undefined.

+  if (!nativeSegwitSigner) return null;
   const nativeSegwitSigner = useCurrentAccountNativeSegwitIndexZeroSigner();
   return useBtcCryptoAssetBalanceNativeSegwit(nativeSegwitSigner.address);
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
};
}
if (!nativeSegwitSigner) return null;
const nativeSegwitSigner = useCurrentAccountNativeSegwitIndexZeroSigner();
return useBtcCryptoAssetBalanceNativeSegwit(nativeSegwitSigner.address);

@fbwoolf fbwoolf force-pushed the fix/ledger-bitcoin-query branch from 640e400 to 1acc40e Compare June 25, 2024 22:14
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 640e400 and 1acc40e.

Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
Files selected for processing (12)
  • package.json (1 hunks)
  • src/app/common/hooks/balance/use-total-balance.tsx (2 hunks)
  • src/app/components/loaders/btc-balance-loader.tsx (2 hunks)
  • src/app/components/loaders/sip10-tokens-loader.tsx (1 hunks)
  • src/app/components/loaders/stacks-account-loader.tsx (1 hunks)
  • src/app/components/loaders/stx-balance-loader.tsx (2 hunks)
  • src/app/features/activity-list/activity-list.tsx (4 hunks)
  • src/app/features/asset-list/asset-list.tsx (4 hunks)
  • src/app/features/asset-list/bitcoin/brc20-token-asset-list/brc20-token-asset-list.tsx (2 hunks)
  • src/app/pages/fund/choose-asset-to-fund/choose-asset-to-fund.tsx (2 hunks)
  • src/app/pages/home/components/send-button.tsx (1 hunks)
  • src/app/query/bitcoin/balance/btc-balance-native-segwit.hooks.ts (1 hunks)
Files skipped from review as they are similar to previous changes (12)
  • package.json
  • src/app/common/hooks/balance/use-total-balance.tsx
  • src/app/components/loaders/btc-balance-loader.tsx
  • src/app/components/loaders/sip10-tokens-loader.tsx
  • src/app/components/loaders/stacks-account-loader.tsx
  • src/app/components/loaders/stx-balance-loader.tsx
  • src/app/features/activity-list/activity-list.tsx
  • src/app/features/asset-list/asset-list.tsx
  • src/app/features/asset-list/bitcoin/brc20-token-asset-list/brc20-token-asset-list.tsx
  • src/app/pages/fund/choose-asset-to-fund/choose-asset-to-fund.tsx
  • src/app/pages/home/components/send-button.tsx
  • src/app/query/bitcoin/balance/btc-balance-native-segwit.hooks.ts

@fbwoolf fbwoolf force-pushed the fix/ledger-bitcoin-query branch from 1acc40e to 03eb692 Compare June 26, 2024 00:30
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 1acc40e and 03eb692.

Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
Files selected for processing (13)
  • package.json (1 hunks)
  • src/app/common/hooks/balance/use-total-balance.tsx (2 hunks)
  • src/app/components/loaders/btc-balance-loader.tsx (2 hunks)
  • src/app/components/loaders/sip10-tokens-loader.tsx (1 hunks)
  • src/app/components/loaders/stacks-account-loader.tsx (1 hunks)
  • src/app/components/loaders/stx-balance-loader.tsx (2 hunks)
  • src/app/features/activity-list/activity-list.tsx (4 hunks)
  • src/app/features/asset-list/asset-list.tsx (4 hunks)
  • src/app/features/asset-list/bitcoin/brc20-token-asset-list/brc20-token-asset-list.tsx (2 hunks)
  • src/app/pages/fund/choose-asset-to-fund/choose-asset-to-fund.tsx (2 hunks)
  • src/app/pages/home/components/send-button.tsx (1 hunks)
  • src/app/pages/home/home.tsx (2 hunks)
  • src/app/query/bitcoin/balance/btc-balance-native-segwit.hooks.ts (1 hunks)
Files skipped from review as they are similar to previous changes (12)
  • package.json
  • src/app/common/hooks/balance/use-total-balance.tsx
  • src/app/components/loaders/btc-balance-loader.tsx
  • src/app/components/loaders/sip10-tokens-loader.tsx
  • src/app/components/loaders/stacks-account-loader.tsx
  • src/app/components/loaders/stx-balance-loader.tsx
  • src/app/features/activity-list/activity-list.tsx
  • src/app/features/asset-list/asset-list.tsx
  • src/app/features/asset-list/bitcoin/brc20-token-asset-list/brc20-token-asset-list.tsx
  • src/app/pages/fund/choose-asset-to-fund/choose-asset-to-fund.tsx
  • src/app/pages/home/components/send-button.tsx
  • src/app/query/bitcoin/balance/btc-balance-native-segwit.hooks.ts
Additional comments not posted (2)
src/app/pages/home/home.tsx (2)

15-15: Approved new import for useCurrentAccountIndex.

This import enhances clarity by providing direct access to the current account index, aligning with the PR's goal of improving code readability and maintainability.


30-30: Refactor: Use of currentAccountIndex in useAccountDisplayName.

The direct use of currentAccountIndex instead of account?.index simplifies the code and potentially avoids a null reference issue if account is undefined. This change should be verified across the application to ensure it doesn't affect existing functionalities.

Also applies to: 34-34

@fbwoolf
Copy link
Contributor Author

fbwoolf commented Jun 26, 2024

Created this issue as a follow up here after discussing with team in standup: #5574

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants