Ensure that one emoji is added, when expected

This commit is contained in:
Scott Nonnenberg 2022-09-15 16:15:56 -07:00 committed by GitHub
parent b290b577d4
commit c6819a5438
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 7 deletions

View File

@ -146,12 +146,9 @@ export const StoryViewsNRepliesModal = ({
const insertEmoji = useCallback(
(e: EmojiPickDataType) => {
if (inputApiRef.current) {
inputApiRef.current.insertEmoji(e);
onUseEmoji(e);
}
onUseEmoji(e);
},
[inputApiRef, onUseEmoji]
[onUseEmoji]
);
const [referenceElement, setReferenceElement] =

View File

@ -152,8 +152,7 @@ export const EmojiPicker = React.memo(
doSend();
e.stopPropagation();
e.preventDefault();
}
if (shortName) {
} else if (shortName) {
onPickEmoji({ skinTone: selectedTone, shortName });
e.stopPropagation();
e.preventDefault();