Permanently redirect to /s/... for share links (#4067)

This commit is contained in:
Apoorv Mishra
2022-09-08 13:14:25 +05:30
committed by GitHub
parent c36dcc9712
commit 97f70edd93
12 changed files with 65 additions and 19 deletions

View File

@@ -9,6 +9,7 @@ import EmojiIcon from "~/components/EmojiIcon";
import Flex from "~/components/Flex";
import { hover } from "~/styles";
import { NavigationNode } from "~/types";
import { sharedDocumentPath } from "~/utils/routeHelpers";
type Props = {
shareId?: string;
@@ -64,7 +65,9 @@ function ReferenceListItem({
return (
<DocumentLink
to={{
pathname: shareId ? `/share/${shareId}${document.url}` : document.url,
pathname: shareId
? sharedDocumentPath(shareId, document.url)
: document.url,
hash: anchor ? `d-${anchor}` : undefined,
state: {
title: document.title,