diff --git a/frontend/src/components/UserProfileDropdown.tsx b/frontend/src/components/UserProfileDropdown.tsx index 03a8c62e..c7203153 100644 --- a/frontend/src/components/UserProfileDropdown.tsx +++ b/frontend/src/components/UserProfileDropdown.tsx @@ -52,6 +52,19 @@ export function UserProfileDropdown({ theme, setTheme, onOpenSettings }: UserPro const { logout, user, isAdmin } = useAuth(); const { license } = useLicense(); const [billingLoading, setBillingLoading] = useState(false); + const [open, setOpen] = useState(false); + + const closeMenu = () => setOpen(false); + + const handleOpenSettings = () => { + closeMenu(); + onOpenSettings(); + }; + + const handleLogout = () => { + closeMenu(); + logout(); + }; const openBillingPortal = async () => { setBillingLoading(true); @@ -67,6 +80,7 @@ export function UserProfileDropdown({ theme, setTheme, onOpenSettings }: UserPro toast.error('Failed to open billing portal.'); } finally { setBillingLoading(false); + closeMenu(); } }; @@ -75,7 +89,7 @@ export function UserProfileDropdown({ theme, setTheme, onOpenSettings }: UserPro const roleLabel = user?.role; return ( - +