fix: Link on 'Not Found' page for root share leads to custom domain landing
This commit is contained in:
@@ -3,6 +3,7 @@ import { useTranslation, Trans } from "react-i18next";
|
|||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import Empty from "~/components/Empty";
|
import Empty from "~/components/Empty";
|
||||||
import Scene from "~/components/Scene";
|
import Scene from "~/components/Scene";
|
||||||
|
import { homePath } from "~/utils/routeHelpers";
|
||||||
|
|
||||||
const Error404 = () => {
|
const Error404 = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@@ -12,7 +13,7 @@ const Error404 = () => {
|
|||||||
<Empty>
|
<Empty>
|
||||||
<Trans>
|
<Trans>
|
||||||
We were unable to find the page you’re looking for. Go to the{" "}
|
We were unable to find the page you’re looking for. Go to the{" "}
|
||||||
<Link to="/home">homepage</Link>?
|
<Link to={homePath()}>homepage</Link>?
|
||||||
</Trans>
|
</Trans>
|
||||||
</Empty>
|
</Empty>
|
||||||
</Scene>
|
</Scene>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import Document from "~/models/Document";
|
|||||||
import env from "~/env";
|
import env from "~/env";
|
||||||
|
|
||||||
export function homePath(): string {
|
export function homePath(): string {
|
||||||
return "/home";
|
return env.ROOT_SHARE_ID ? "/" : "/home";
|
||||||
}
|
}
|
||||||
|
|
||||||
export function draftsPath(): string {
|
export function draftsPath(): string {
|
||||||
|
|||||||
Reference in New Issue
Block a user