Fix the crash caused by the emoji board load

This commit is contained in:
Gigiaj 2025-06-18 21:49:32 -05:00
parent 9e7b37dcd1
commit a6898e1484

View file

@ -197,7 +197,6 @@ export function MessageOptionsMenu({
}: ExtendedOptionsProps) { }: ExtendedOptionsProps) {
const screenSize = useScreenSizeContext(); const screenSize = useScreenSizeContext();
const isMobile = screenSize === ScreenSize.Mobile; const isMobile = screenSize === ScreenSize.Mobile;
const [view, setView] = useState('options');
const eventId = mEvent.getId(); const eventId = mEvent.getId();
if (!eventId) return null; if (!eventId) return null;
@ -247,7 +246,7 @@ export function MessageOptionsMenu({
}} }}
isOpen={isEmojiBoardOpen} isOpen={isEmojiBoardOpen}
> >
<Suspense fallback={<p>Loading</p>}> <Suspense fallback={<p> </p>}>
<EmojiBoard <EmojiBoard
imagePackRooms={imagePackRooms ?? []} imagePackRooms={imagePackRooms ?? []}
returnFocusOnDeactivate returnFocusOnDeactivate
@ -287,20 +286,22 @@ export function MessageOptionsMenu({
offset={emojiBoardAnchor?.width === 0 ? 0 : undefined} offset={emojiBoardAnchor?.width === 0 ? 0 : undefined}
anchor={emojiBoardAnchor} anchor={emojiBoardAnchor}
content={ content={
<EmojiBoard <Suspense fallback={<p> </p>}>
imagePackRooms={imagePackRooms ?? []} <EmojiBoard
returnFocusOnDeactivate={false} imagePackRooms={imagePackRooms ?? []}
allowTextCustomEmoji returnFocusOnDeactivate={false}
onEmojiSelect={(key) => { allowTextCustomEmoji
onReactionToggle(eventId, key); onEmojiSelect={(key) => {
setEmojiBoardAnchor(undefined); onReactionToggle(eventId, key);
}} setEmojiBoardAnchor(undefined);
onCustomEmojiSelect={(mxc, shortcode) => { }}
onReactionToggle(eventId, mxc, shortcode); onCustomEmojiSelect={(mxc, shortcode) => {
setEmojiBoardAnchor(undefined); onReactionToggle(eventId, mxc, shortcode);
}} setEmojiBoardAnchor(undefined);
requestClose={() => setEmojiBoardAnchor(undefined)} }}
/> requestClose={() => setEmojiBoardAnchor(undefined)}
/>
</Suspense>
} }
> >
<IconButton <IconButton