mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-08 03:32:27 +09:00
fix(app): stop the skin tone selector listening while closed (#1921)
This commit is contained in:
@@ -96,11 +96,14 @@ export const SkinToneSelector = observer(() => {
|
||||
}
|
||||
}, []);
|
||||
useEffect(() => {
|
||||
if (!isOpen) {
|
||||
return undefined;
|
||||
}
|
||||
document.addEventListener('mousedown', handleClickOutside);
|
||||
return () => {
|
||||
document.removeEventListener('mousedown', handleClickOutside);
|
||||
};
|
||||
}, [handleClickOutside]);
|
||||
}, [handleClickOutside, isOpen]);
|
||||
return (
|
||||
<div
|
||||
ref={selectorRef}
|
||||
|
||||
Reference in New Issue
Block a user