Repository navigation
fix(Toast): remove viewport listeners when a toast is dismissed - #2809
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughToast viewport listener teardown now uses the watch effect cleanup callback. Tests cover removal of both pause and resume listeners when a Toast is dismissed. ChangesToast listener cleanup
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration. 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 |
|
Thanks for the PR @lazerg ! |
commit: |
Each toast registers pause and resume listeners on the shared viewport inside a
watchEffect, but the teardown was returned from the effect callback instead of being registered through its cleanup argument, sowatchEffectsilently discarded it. Every dismissed toast therefore left its listeners and detached<li>subtree attached to the viewport, leaking on each open/close cycle. This registers the cleanup through thewatchEffectcleanup callback so the listeners are removed when the toast unmounts.Fixes #2782
Summary by CodeRabbit