From 10a0ae9518a38831e912d599c082037f1e41496a Mon Sep 17 00:00:00 2001 From: Komediruzecki Date: Mon, 30 May 2022 14:30:19 +0200 Subject: [PATCH] Add share doc and preview only open attachment warning --- src/cloud/components/Editor/index.tsx | 3 +++ .../components/MarkdownView/CustomizedMarkdownPreviewer.tsx | 2 +- src/mobile/components/pages/DocViewPage.tsx | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/cloud/components/Editor/index.tsx b/src/cloud/components/Editor/index.tsx index 7371c98a63..639530cb0a 100644 --- a/src/cloud/components/Editor/index.tsx +++ b/src/cloud/components/Editor/index.tsx @@ -1050,6 +1050,9 @@ const Editor = ({ className='scroller' getEmbed={getEmbed} scrollerRef={previewRef} + showLinkOpenWarning={ + !docIsEditable || !currentUserIsCoreMember + } /> diff --git a/src/cloud/components/MarkdownView/CustomizedMarkdownPreviewer.tsx b/src/cloud/components/MarkdownView/CustomizedMarkdownPreviewer.tsx index 144b49cedb..4c94d3c854 100644 --- a/src/cloud/components/MarkdownView/CustomizedMarkdownPreviewer.tsx +++ b/src/cloud/components/MarkdownView/CustomizedMarkdownPreviewer.tsx @@ -35,7 +35,7 @@ const CustomizedMarkdownPreviewer = ({ getEmbed, scrollerRef, codeFence = true, - showLinkOpenWarning, + showLinkOpenWarning = false, }: CustomizedMarkdownViewProps) => { const { previewStyle } = usePreviewStyle() const { settings } = useSettings() diff --git a/src/mobile/components/pages/DocViewPage.tsx b/src/mobile/components/pages/DocViewPage.tsx index 135448ab71..13f4fb41ea 100644 --- a/src/mobile/components/pages/DocViewPage.tsx +++ b/src/mobile/components/pages/DocViewPage.tsx @@ -142,6 +142,7 @@ const ViewPage = ({ onRender={onRender.current} className='scroller' scrollerRef={previewRef} + showLinkOpenWarning={true} /> ) : ( <>