a955a7368c
- Introduce messagesRef to track messages without causing re-renders - Simplify event listener management with more concise useEffect hooks - Improve auto-rename topic logic with current messages reference - Remove commented-out code and unused event listeners - Enhance type safety and reduce dependency complexity