fix: Plain chat not opening from help button for free users and on bookings list page (#23491)
This commit is contained in:
1 parent
b101157d67
commit
0a9e732ea4
5 files changed
+66
-59
No files matched your search
@@ -56,11 +56,19 @@ export function UserDropdown({ small }: UserDropdownProps) {
|
||||
|
||||
const [menuOpen, setMenuOpen] = useState(false);
|
||||
|
||||
const handleHelpClick = () => {
|
||||
if (window.Plain) {
|
||||
window.Plain.open();
|
||||
}
|
||||
const handleHelpClick = (e?: React.MouseEvent) => {
|
||||
e?.preventDefault();
|
||||
e?.stopPropagation();
|
||||
|
||||
setMenuOpen(false);
|
||||
|
||||
// Defer to next frame to avoid the originating click closing the dialog
|
||||
requestAnimationFrame(() => {
|
||||
// double RAF is extra-safe if your dropdown unmounts with a transition
|
||||
requestAnimationFrame(() => {
|
||||
if (window.Plain) window.Plain.open();
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
// Prevent rendering dropdown if user isn't available.
|
||||
|
||||
Reference in new issue
Block a user