-
Notifications
You must be signed in to change notification settings - Fork 39
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
[Gateway] fix: loading screen and connect accounts on reload #1703
Conversation
WalkthroughThe update to the wallet provider involves modifying the Changes
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 X ? TipsChat with CodeRabbit Bot (
|
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.
Review Status
Actionable comments generated: 1
Configuration used: CodeRabbit UI
Files selected for processing (1)
- tools/walletextension/frontend/src/components/providers/wallet-provider.tsx (2 hunks)
Additional comments: 2
tools/walletextension/frontend/src/components/providers/wallet-provider.tsx (2)
46-68: The update to the
initialize
function to accept aproviderInstance
parameter is a good change for explicit dependency injection, which can make the function easier to test and maintain. Ensure that all calls toinitialize
throughout the codebase have been updated to include the newproviderInstance
parameter.187-198: The
ethereum.on
event listener foraccountsChanged
callsfetchUserAccounts
, which may need to be updated to use the newproviderInstance
if it previously relied on the oldprovider
state. Verify thatfetchUserAccounts
is correctly using the newproviderInstance
and not the oldprovider
state.Verification successful
The
fetchUserAccounts
function uses theprovider
from theuseWalletConnection
context, which is updated to the newproviderInstance
within theuseEffect
hook inwallet-provider.tsx
. This confirms thatfetchUserAccounts
indirectly uses the newproviderInstance
, aligning with the changes made in the pull request.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for `fetchUserAccounts` function definition to ensure it uses the new `providerInstance`. ast-grep --lang typescript --pattern $'fetchUserAccounts($_)'Length of output: 62
Script:
#!/bin/bash # Search for the `fetchUserAccounts` function definition in a broader scope without specifying arguments. ast-grep --lang typescript --pattern $'fetchUserAccounts($$$)'Length of output: 166
Script:
#!/bin/bash # Extract the content of the file where `fetchUserAccounts` is being called to analyze the function definition. rg 'fetchUserAccounts' ./tools/walletextension/frontend/src/services/useGatewayService.tsLength of output: 183
Script:
#!/bin/bash # Search for the definition of `fetchUserAccounts` within the file `useGatewayService.ts`. ast-grep --lang typescript --pattern $'fetchUserAccounts($$$)' --file-pattern 'useGatewayService.ts'Length of output: 295
Script:
#!/bin/bash # Search for the definition of `fetchUserAccounts` within the file `useGatewayService.ts` without using the unsupported argument. ast-grep --lang typescript --pattern $'fetchUserAccounts($$$)'Length of output: 166
Script:
#!/bin/bash # Use `rg` to extract the function definition of `fetchUserAccounts` from `useGatewayService.ts`. rg 'function fetchUserAccounts' ./tools/walletextension/frontend/src/services/useGatewayService.ts -A 10Length of output: 106
Script:
#!/bin/bash # Use `rg` to extract the broader function definition of `fetchUserAccounts` from `useGatewayService.ts`. rg 'fetchUserAccounts' ./tools/walletextension/frontend/src/services/useGatewayService.ts -A 10 -B 10Length of output: 1226
Script:
#!/bin/bash # Search for the definition of `useWalletConnection` to find where `fetchUserAccounts` is provided from. rg 'useWalletConnection' -A 10 -B 10Length of output: 25322
Script:
#!/bin/bash # Use `rg` to extract the implementation of `fetchUserAccounts` from `wallet-provider.tsx`. rg 'fetchUserAccounts' ./tools/walletextension/frontend/src/components/providers/wallet-provider.tsx -A 10 -B 10Length of output: 1621
tools/walletextension/frontend/src/components/providers/wallet-provider.tsx
Show resolved
Hide resolved
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (1)
- tools/walletextension/frontend/src/components/providers/wallet-provider.tsx (2 hunks)
Files skipped from review as they are similar to previous changes (1)
- tools/walletextension/frontend/src/components/providers/wallet-provider.tsx
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.
LGTM
Why this change is needed
Please provide a description and a link to the underlying ticket
What changes were made as part of this PR
Please provide a high level list of the changes made
PR checks pre-merging
Please indicate below by ticking the checkbox that you have read and performed the required
PR checks