Fix Lightbox crash
This commit is contained in:
parent
fd8bd54de5
commit
3d1e2c220e
1 changed files with 1 additions and 1 deletions
|
@ -86,7 +86,7 @@ export function Lightbox({
|
|||
hasPrevMessage,
|
||||
}: PropsType): JSX.Element | null {
|
||||
const hasThumbnails = media.length > 1;
|
||||
const messageId = media[0].message.id;
|
||||
const messageId = media.at(0)?.message.id;
|
||||
const prevMessageId = usePrevious(messageId, messageId);
|
||||
const needsAnimation = messageId !== prevMessageId;
|
||||
const [root, setRoot] = React.useState<HTMLElement | undefined>();
|
||||
|
|
Loading…
Reference in a new issue