fix: Crash rendering some document hover previews
This commit is contained in:
@@ -1,7 +1,9 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
import { richExtensions } from "@shared/editor/nodes";
|
||||||
import { UnfurlResourceType, UnfurlResponse } from "@shared/types";
|
import { UnfurlResourceType, UnfurlResponse } from "@shared/types";
|
||||||
import Editor from "~/components/Editor";
|
import Editor from "~/components/Editor";
|
||||||
import Flex from "~/components/Flex";
|
import Flex from "~/components/Flex";
|
||||||
|
import ErrorBoundary from "../ErrorBoundary";
|
||||||
import {
|
import {
|
||||||
Preview,
|
Preview,
|
||||||
Title,
|
Title,
|
||||||
@@ -21,20 +23,23 @@ const HoverPreviewDocument = React.forwardRef(function _HoverPreviewDocument(
|
|||||||
<Preview to={url}>
|
<Preview to={url}>
|
||||||
<Card ref={ref}>
|
<Card ref={ref}>
|
||||||
<CardContent>
|
<CardContent>
|
||||||
<Flex column gap={2}>
|
<ErrorBoundary showTitle={false} reloadOnChunkMissing={false}>
|
||||||
<Title>{title}</Title>
|
<Flex column gap={2}>
|
||||||
<Info>{lastActivityByViewer}</Info>
|
<Title>{title}</Title>
|
||||||
<Description as="div">
|
<Info>{lastActivityByViewer}</Info>
|
||||||
<React.Suspense fallback={<div />}>
|
<Description as="div">
|
||||||
<Editor
|
<React.Suspense fallback={<div />}>
|
||||||
key={id}
|
<Editor
|
||||||
defaultValue={summary}
|
key={id}
|
||||||
embedsDisabled
|
extensions={richExtensions}
|
||||||
readOnly
|
defaultValue={summary}
|
||||||
/>
|
embedsDisabled
|
||||||
</React.Suspense>
|
readOnly
|
||||||
</Description>
|
/>
|
||||||
</Flex>
|
</React.Suspense>
|
||||||
|
</Description>
|
||||||
|
</Flex>
|
||||||
|
</ErrorBoundary>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
</Preview>
|
</Preview>
|
||||||
|
|||||||
Reference in New Issue
Block a user