Web:Common:Add close InfoPanel for unmounting a component.

This commit is contained in:
Vlada Gazizova 2022-11-18 15:48:50 +03:00
parent b4791418b7
commit 36798c4241

View File

@ -153,7 +153,10 @@ const InfoPanel = ({
if (!isDesktop() && isVisible) closeInfoPanel();
};
return () => document.removeEventListener("mousedown", onMouseDown);
return () => {
document.removeEventListener("mousedown", onMouseDown);
closeInfoPanel();
};
}, []);
return (