From 6502aff4ef53d75ebbdbf87a05f9574c180f6c77 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Tue, 13 Sep 2022 00:34:00 +0100 Subject: [PATCH] fix: Toggling history sidebar should not push into history stack --- app/components/DocumentMeta.tsx | 10 +++++++++- app/components/DocumentMetaWithViews.tsx | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/components/DocumentMeta.tsx b/app/components/DocumentMeta.tsx index 9216d2b6c..f96c9be94 100644 --- a/app/components/DocumentMeta.tsx +++ b/app/components/DocumentMeta.tsx @@ -18,6 +18,7 @@ type Props = { showLastViewed?: boolean; showParentDocuments?: boolean; document: Document; + replace?: boolean; to?: LocationDescriptor; }; @@ -28,6 +29,7 @@ const DocumentMeta: React.FC = ({ showParentDocuments, document, children, + replace, to, ...rest }) => { @@ -145,7 +147,13 @@ const DocumentMeta: React.FC = ({ return ( - {to ? {content} : content} + {to ? ( + + {content} + + ) : ( + content + )} {showCollection && collection && (  {t("in")}  diff --git a/app/components/DocumentMetaWithViews.tsx b/app/components/DocumentMetaWithViews.tsx index 8c23bd334..08e1e8309 100644 --- a/app/components/DocumentMetaWithViews.tsx +++ b/app/components/DocumentMetaWithViews.tsx @@ -31,7 +31,7 @@ function DocumentMetaWithViews({ to, isDraft, document, ...rest }: Props) { }); return ( - + {totalViewers && !isDraft ? ( {(props) => (