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,6 +286,7 @@ export function MessageOptionsMenu({
offset={emojiBoardAnchor?.width === 0 ? 0 : undefined} offset={emojiBoardAnchor?.width === 0 ? 0 : undefined}
anchor={emojiBoardAnchor} anchor={emojiBoardAnchor}
content={ content={
<Suspense fallback={<p> </p>}>
<EmojiBoard <EmojiBoard
imagePackRooms={imagePackRooms ?? []} imagePackRooms={imagePackRooms ?? []}
returnFocusOnDeactivate={false} returnFocusOnDeactivate={false}
@ -301,6 +301,7 @@ export function MessageOptionsMenu({
}} }}
requestClose={() => setEmojiBoardAnchor(undefined)} requestClose={() => setEmojiBoardAnchor(undefined)}
/> />
</Suspense>
} }
> >
<IconButton <IconButton