fix: Do not copy edit path from headers
chore: Rename url -> path in routeHelpers closes #5229
This commit is contained in:
@@ -10,7 +10,7 @@ import Document from "~/models/Document";
|
||||
import DocumentMeta from "~/components/DocumentMeta";
|
||||
import Fade from "~/components/Fade";
|
||||
import useStores from "~/hooks/useStores";
|
||||
import { documentUrl, documentInsightsUrl } from "~/utils/routeHelpers";
|
||||
import { documentPath, documentInsightsPath } from "~/utils/routeHelpers";
|
||||
|
||||
type Props = {
|
||||
/* The document to display meta data for */
|
||||
@@ -32,7 +32,7 @@ function TitleDocumentMeta({ to, isDraft, document, ...rest }: Props) {
|
||||
|
||||
const Wrapper = viewsLoadedOnMount.current ? React.Fragment : Fade;
|
||||
|
||||
const insightsUrl = documentInsightsUrl(document);
|
||||
const insightsPath = documentInsightsPath(document);
|
||||
const commentsCount = comments.inDocument(document.id).length;
|
||||
|
||||
return (
|
||||
@@ -41,7 +41,9 @@ function TitleDocumentMeta({ to, isDraft, document, ...rest }: Props) {
|
||||
<Wrapper>
|
||||
•
|
||||
<Link
|
||||
to={match.url === insightsUrl ? documentUrl(document) : insightsUrl}
|
||||
to={
|
||||
match.url === insightsPath ? documentPath(document) : insightsPath
|
||||
}
|
||||
>
|
||||
{t("Viewed by")}{" "}
|
||||
{onlyYou
|
||||
@@ -56,7 +58,7 @@ function TitleDocumentMeta({ to, isDraft, document, ...rest }: Props) {
|
||||
<>
|
||||
•
|
||||
<CommentLink
|
||||
to={documentUrl(document)}
|
||||
to={documentPath(document)}
|
||||
onClick={() => ui.toggleComments(document.id)}
|
||||
>
|
||||
<CommentIcon size={18} />
|
||||
|
||||
Reference in New Issue
Block a user