Skip to content

Commit

Permalink
Build fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
przemvs committed Aug 18, 2022
1 parent 2357b25 commit 3cf990b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/script/components/Emoji/useEmoji.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -393,14 +393,14 @@ const useEmoji = (
) : null;

useEffect(() => {
if (!isVisible) {
return;
if (isVisible) {
window.addEventListener('click', removeEmojiPopup);
}

window.addEventListener('click', removeEmojiPopup);

return () => {
window.removeEventListener('click', removeEmojiPopup);
if (isVisible) {
window.removeEventListener('click', removeEmojiPopup);
}
};
}, [isVisible]);

Expand Down

0 comments on commit 3cf990b

Please sign in to comment.