Fix undefined customEmojis

This commit is contained in:
Lim Chee Aun 2023-02-23 11:36:07 +08:00
parent 63c6637c24
commit bd728df79b

View file

@ -141,20 +141,6 @@ function Compose({
const prefs = store.account.get('preferences') || {};
const customEmojis = useRef();
useEffect(() => {
(async () => {
try {
const emojis = await masto.v1.customEmojis.list();
console.log({ emojis });
customEmojis.current = emojis;
} catch (e) {
// silent fail
console.error(e);
}
})();
}, []);
const oninputTextarea = () => {
if (!textareaRef.current) return;
textareaRef.current.dispatchEvent(new Event('input'));
@ -1057,6 +1043,20 @@ const Textarea = forwardRef((props, ref) => {
const snapStates = useSnapshot(states);
const charCount = snapStates.composerCharacterCount;
const customEmojis = useRef();
useEffect(() => {
(async () => {
try {
const emojis = await masto.v1.customEmojis.list();
console.log({ emojis });
customEmojis.current = emojis;
} catch (e) {
// silent fail
console.error(e);
}
})();
}, []);
const textExpanderRef = useRef();
const textExpanderTextRef = useRef('');
useEffect(() => {