detach receiveMessage handler

This commit is contained in:
svetlagasheva 2020-04-28 18:53:30 +03:00
parent 4105e7eeb5
commit a4887ce89d

View file

@ -71,6 +71,9 @@ const MetaDetails = ({ urlParams, queryParams }) => {
}, []);
React.useEffect(() => {
window.addEventListener('message', receiveMessage, false);
return () => {
window.removeEventListener('message', receiveMessage);
};
}, []);
const [inLibrary, toggleInLibrary] = useInLibrary(selectedMetaResource !== null && selectedMetaResource.content.type === 'Ready' ? selectedMetaResource.content.content : null);
return (