fix: Do not copy edit path from headers

chore: Rename url -> path in routeHelpers
closes #5229
This commit is contained in:
Tom Moor
2023-04-22 10:00:09 -04:00
parent 4b5680a16e
commit e2c5fda610
19 changed files with 91 additions and 80 deletions

View File

@@ -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>
&nbsp;&nbsp;
<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) {
<>
&nbsp;&nbsp;
<CommentLink
to={documentUrl(document)}
to={documentPath(document)}
onClick={() => ui.toggleComments(document.id)}
>
<CommentIcon size={18} />