From 10ec8a59b4fa6a60e28c730b68bd22a42ad3aea0 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Wed, 23 Aug 2023 22:34:21 -0400 Subject: [PATCH] fix: Disable previews in notification items --- app/components/Editor.tsx | 4 +++- app/components/Notifications/NotificationListItem.tsx | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/components/Editor.tsx b/app/components/Editor.tsx index d53745021..9ee133cd5 100644 --- a/app/components/Editor.tsx +++ b/app/components/Editor.tsx @@ -48,6 +48,7 @@ export type Props = Optional< > & { shareId?: string | undefined; embedsDisabled?: boolean; + previewsDisabled?: boolean; onHeadingsChange?: (headings: Heading[]) => void; onSynced?: () => Promise; onPublish?: (event: React.MouseEvent) => any; @@ -62,6 +63,7 @@ function Editor(props: Props, ref: React.RefObject | null) { onHeadingsChange, onCreateCommentMark, onDeleteCommentMark, + previewsDisabled, } = props; const userLocale = useUserLocale(); const locale = dateLocale(userLocale); @@ -339,7 +341,7 @@ function Editor(props: Props, ref: React.RefObject | null) { userPreferences={preferences} dictionary={dictionary} {...props} - onHoverLink={handleLinkActive} + onHoverLink={previewsDisabled ? undefined : handleLinkActive} onClickLink={handleClickLink} onSearchLink={handleSearchLink} onChange={handleChange} diff --git a/app/components/Notifications/NotificationListItem.tsx b/app/components/Notifications/NotificationListItem.tsx index 661eb2469..6d21f9fc4 100644 --- a/app/components/Notifications/NotificationListItem.tsx +++ b/app/components/Notifications/NotificationListItem.tsx @@ -64,6 +64,7 @@ function NotificationListItem({ notification, onNavigate }: Props) { {notification.comment && ( )}