Live video on the AT Protocol

app: fixes for emoji on native

authored by

Eli Mallon and committed by
Natalie B.
857497d4 20851caf

+12 -6
+5
js/app/utils/emoji.native.ts
···
··· 1 + import { EmojiData } from "@streamplace/components/src/components/chat/emoji-suggestions"; 2 + 3 + export function useEmojiData(): EmojiData | null { 4 + return null; 5 + }
+7 -6
js/app/utils/emoji.ts
··· 1 // emoji cache file 2 - 3 import { EmojiData } from "@streamplace/components/src/components/chat/emoji-suggestions"; 4 - import { useState } from "react"; 5 6 let emojiPromise: Promise< 7 typeof import("../assets/emoji-data-stripped.json") 8 > | null = null; 9 - 10 export function useEmojiData(): EmojiData | null { 11 const [emoji, setEmoji] = useState<EmojiData | null>(null); 12 if (!emojiPromise) { 13 emojiPromise = import("../assets/emoji-data-stripped.json"); 14 } 15 - emojiPromise.then((emoji) => { 16 - setEmoji(emoji); 17 - }); 18 return emoji; 19 }
··· 1 // emoji cache file 2 import { EmojiData } from "@streamplace/components/src/components/chat/emoji-suggestions"; 3 + 4 + import { useEffect, useState } from "react"; 5 6 let emojiPromise: Promise< 7 typeof import("../assets/emoji-data-stripped.json") 8 > | null = null; 9 export function useEmojiData(): EmojiData | null { 10 const [emoji, setEmoji] = useState<EmojiData | null>(null); 11 if (!emojiPromise) { 12 emojiPromise = import("../assets/emoji-data-stripped.json"); 13 } 14 + useEffect(() => { 15 + emojiPromise!.then((emoji) => { 16 + setEmoji(emoji); 17 + }); 18 + }, []); 19 return emoji; 20 }