fix: Toggling history sidebar should not push into history stack

This commit is contained in:
Tom Moor
2022-09-13 00:34:00 +01:00
parent 34fd039b6c
commit 6502aff4ef
2 changed files with 10 additions and 2 deletions

View File

@@ -18,6 +18,7 @@ type Props = {
showLastViewed?: boolean;
showParentDocuments?: boolean;
document: Document;
replace?: boolean;
to?: LocationDescriptor;
};
@@ -28,6 +29,7 @@ const DocumentMeta: React.FC<Props> = ({
showParentDocuments,
document,
children,
replace,
to,
...rest
}) => {
@@ -145,7 +147,13 @@ const DocumentMeta: React.FC<Props> = ({
return (
<Container align="center" rtl={document.dir === "rtl"} {...rest} dir="ltr">
{to ? <Link to={to}>{content}</Link> : content}
{to ? (
<Link to={to} replace={replace}>
{content}
</Link>
) : (
content
)}
{showCollection && collection && (
<span>
&nbsp;{t("in")}&nbsp;