bc95237b7c
The error occurred because the AccountSwitcher component was returning null while the DropdownMenu was still mounted and open. This caused React to throw a minified error #300 about invalid elements. The fix ensures the dropdown menu is closed before removing the login, preventing the component from being unmounted while still rendering its dropdown content. Changes: - Added controlled state for dropdown menu (isOpen/setIsOpen) - Created handleLogout function that closes dropdown before removing login - Used setTimeout to ensure dropdown closes before state update Co-authored-by: shakespeare.diy <assistant@shakespeare.diy>