MCPcopy Create free account
hub / github.com/dailydotdev/apps / updateEmojiQuery

Function updateEmojiQuery

packages/shared/src/hooks/input/useMarkdownInput.ts:299–314  ·  view source on GitHub ↗
(value: string | undefined)

Source from the content-addressed store, hash-verified

297 };
298
299 const updateEmojiQuery = (value: string | undefined) => {
300 if (
301 !isEmojiEnabled ||
302 value === emojiQuery ||
303 (!!value && specialCharsRegex.test(value))
304 ) {
305 return;
306 }
307
308 if (isNullOrUndefined(emojiQuery) && !isNullOrUndefined(value)) {
309 setOffset(getCaretOffset(textarea));
310 setSelectedEmoji(0);
311 }
312
313 setEmojiQuery(value);
314 };
315
316 const onApplyMention = async (mention: UserShortProfile) => {
317 const textareaCommand = getCommand();

Callers 2

onApplyEmojiFunction · 0.85
checkEmojiFunction · 0.85

Calls 2

isNullOrUndefinedFunction · 0.90
getCaretOffsetFunction · 0.90

Tested by

no test coverage detected