From 05b3a39f4da9da2a084ccbd6d02626425694b587 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sun, 12 Jan 2025 21:58:01 -0500 Subject: [PATCH] preload --- shared/editor/components/Mentions.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/shared/editor/components/Mentions.tsx b/shared/editor/components/Mentions.tsx index 33a854cc89..e8256150e3 100644 --- a/shared/editor/components/Mentions.tsx +++ b/shared/editor/components/Mentions.tsx @@ -34,6 +34,13 @@ export const MentionDocument = observer(function MentionDocument_( const { isSelected, node } = props; const { documents } = useStores(); const doc = documents.get(node.attrs.modelId); + const modelId = node.attrs.modelId; + + React.useEffect(() => { + if (modelId) { + void documents.prefetchDocument(modelId); + } + }, [modelId, documents]); return (