-
Notifications
You must be signed in to change notification settings - Fork 17
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: fix loading contracts using code_id in query params #1236
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThe frontend underwent a significant update where 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 your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Additionally, you can add CodeRabbit Configration File (
|
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.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- frontend/src/app/(routes)/cosmwasm/[network]/PageContracts.tsx (1 hunks)
Additional comments not posted (2)
frontend/src/app/(routes)/cosmwasm/[network]/PageContracts.tsx (2)
22-22
: The introduction ofparamsCodeId
to capture thecode_id
query parameter is correct and follows best practices.
30-34
: TheuseEffect
hook correctly updates the selected tab to 'All Contracts' whenparamsCodeId
is present. Ensure that the dependency array[paramsCodeId]
is accurate and only triggers whenparamsCodeId
changes.Verification successful
The
useEffect
hook inPageContracts.tsx
correctly updates the selected tab to 'All Contracts' whenparamsCodeId
is present and has the appropriate dependency array[paramsCodeId]
. This ensures that the effect only triggers whenparamsCodeId
changes.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the dependency array for the useEffect hook is accurate and only triggers when `paramsCodeId` changes. # Test: Search for the useEffect hook with `paramsCodeId` in the dependency array. Expect: Only occurances with correct dependency array. rg --type js --type ts $'useEffect(() => {\n if (paramsCodeId?.length) {\n setSelectedTab(\'All Contracts\');\n }\n }, [paramsCodeId]);'Length of output: 522
Script:
#!/bin/bash # Description: Verify that the dependency array for the useEffect hook is accurate and only triggers when `paramsCodeId` changes. # Test: Search for the useEffect hook with `paramsCodeId` in the dependency array. Expect: Only occurrences with correct dependency array. rg --type js --type ts 'useEffect\(\(\) => \{\s+if \(paramsCodeId\?\.\length\) \{\s+setSelectedTab\('\'All Contracts\'\);\s+\}\s+\}, \[paramsCodeId\]\);'Length of output: 93
Script:
#!/bin/bash # Description: Verify that the dependency array for the useEffect hook is accurate and only triggers when `paramsCodeId` changes. # Test: Search for the useEffect hook with `paramsCodeId` in the dependency array. Expect: Only occurrences with correct dependency array. rg --type js --type ts 'useEffect\(\(\) => \{\s+if \(paramsCodeId\?\.\length\) \{\s+setSelectedTab\("All Contracts"\);\s+\}\s+\}, \[paramsCodeId\]\);'Length of output: 389
Script:
#!/bin/bash # Description: Verify that the dependency array for the useEffect hook is accurate and only triggers when `paramsCodeId` changes. # Test: Search for the useEffect hook with `paramsCodeId` in the dependency array. Expect: Only occurrences with correct dependency array. rg --type js --type ts 'useEffect\(.*\[paramsCodeId\]\);'Length of output: 59
Script:
#!/bin/bash # Description: Search for all useEffect hooks and manually inspect those involving `paramsCodeId`. # Test: Search for all useEffect hooks. rg --type js --type ts 'useEffect\('Length of output: 13555
Script:
#!/bin/bash # Description: Extract the useEffect hook from PageContracts.tsx to verify the dependency array. # Test: Extract the useEffect hook from PageContracts.tsx. rg --type js --type ts -A 5 'useEffect\(' frontend/src/app/\(routes\)/cosmwasm/\[network\]/PageContracts.tsxLength of output: 360
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.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- frontend/src/app/(routes)/cosmwasm/components/AddAddresses.tsx (1 hunks)
Files skipped from review due to trivial changes (1)
- frontend/src/app/(routes)/cosmwasm/components/AddAddresses.tsx
Summary by CodeRabbit
code_id
now sets the selected tab to 'All Contracts' automatically, enhancing navigation efficiency.