mirror of
https://github.com/xtr-dev/rondevu-demo.git
synced 2025-12-10 10:53:22 +00:00
Fix: Add cleanup on component unmount
- Close all connections when component unmounts - Prevents polling timers from running after unmount - Better resource cleanup 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -71,6 +71,14 @@ export default function App() {
|
||||
}
|
||||
}, []);
|
||||
|
||||
// Cleanup on unmount
|
||||
useEffect(() => {
|
||||
return () => {
|
||||
// Close all connections when component unmounts
|
||||
myConnections.forEach(c => c.conn?.close());
|
||||
};
|
||||
}, [myConnections]);
|
||||
|
||||
// Register
|
||||
const handleRegister = async () => {
|
||||
if (!client) return;
|
||||
|
||||
Reference in New Issue
Block a user