Restore call reactions click outside to dismiss

This commit is contained in:
ayumi-signal
2024-01-24 09:33:20 -08:00
committed by GitHub
parent 36c834ea26
commit 7065ef0885

View File

@@ -71,6 +71,7 @@ import {
PersistentCallingToast,
useCallingToasts,
} from './CallingToast';
import { handleOutsideClick } from '../util/handleOutsideClick';
import { Spinner } from './Spinner';
import type { Props as ReactionPickerProps } from './conversation/ReactionPicker';
import type { SmartReactionPicker } from '../state/smart/ReactionPicker';
@@ -328,6 +329,22 @@ export function CallScreen({
};
}, [toggleAudio, toggleVideo]);
useEffect(() => {
if (!showReactionPicker) {
return noop;
}
return handleOutsideClick(
() => {
setShowReactionPicker(false);
return true;
},
{
containerElements: [reactButtonRef, reactionPickerContainerRef],
name: 'CallScreen.reactionPicker',
}
);
}, [showReactionPicker]);
useScreenSharingStoppedToast({ activeCall, i18n });
useViewModeChangedToast({ activeCall, i18n });