Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(md): make unfurl link data in floating menu reactive (#1159)

Aidan Holloway-Bidwellfff3b9e545d7
diff --git a/js/app/packages/core/component/LexicalMarkdown/component/menu/FloatingLinkMenu.tsx b/js/app/packages/core/component/LexicalMarkdown/component/menu/FloatingLinkMenu.tsx
index dabe1adf76..05fad372f3 100644
--- a/js/app/packages/core/component/LexicalMarkdown/component/menu/FloatingLinkMenu.tsx
+++ b/js/app/packages/core/component/LexicalMarkdown/component/menu/FloatingLinkMenu.tsx
@@ -123,8 +123,6 @@ export function FloatingLinkMenu(props: { closePopup?: () => void }) {
setTimeout(() => setPreviewHover(true));
};
- const [unfurlData] = useUnfurl(linkInfo()?.url);
-
// Passed to link plugin in to be called when the a link is clicked.
const onClickLink = (link?: ILinkInfo) => {
if (link === undefined) {
@@ -322,7 +320,7 @@ export function FloatingLinkMenu(props: { closePopup?: () => void }) {
const unfurledDetails = createMemo(() => {
const url = linkInfo()?.url;
if (!url) return null;
- const data = unfurlData();
+ const data = useUnfurl(url)[0]();
if (!data || data.type !== 'success') {
return {
url,