Fix: [BUG] [v1.1.0] AuxiliarySidebar: onVisibilityChange runs on mount, not only on visibility changes#39614
Conversation
… on mount, not only on visibility changes Signed-off-by: willkhinz <hinzwilliam52@gmail.com>
… on mount, not only on visibility changes Signed-off-by: willkhinz <hinzwilliam52@gmail.com>
… on mount, not only on visibility changes Signed-off-by: willkhinz <hinzwilliam52@gmail.com>
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 26 minutes and 14 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Description
Fix for the
AuxiliarySidebarcomponent where theonVisibilityChangefunction runs on mount instead of only on visibility changes.Related Issue
Fixes #<issue_number> (replace with actual issue number from https://github.com/PlatformNetwork/bounty-challenge)
Type of Change
Checklist
Testing
To verify the changes, the following commands were run:
cargo test cargo clippyAdditionally, manual testing was performed to ensure the
onVisibilityChangefunction behaves as expected.Screenshots (if applicable)
No screenshots are necessary for this change.
🔍 Analysis
The
onVisibilityChangefunction in theAuxiliarySidebarcomponent is executing on mount, rather than only on visibility changes. This is likely due to the event listener being triggered on component initialization.🛠️ Implementation
To resolve this issue, the event listener should be modified to only trigger when the visibility of the component actually changes. This can be achieved by adding a conditional check to verify if the component's visibility has changed before executing the
onVisibilityChangefunction.✅ Verification
AuxiliarySidebarcomponent and verify that theonVisibilityChangefunction is not executed.onVisibilityChangefunction is executed as expected.