feat: add share url alias /s

This commit is contained in:
Elias Schneider
2023-07-22 16:09:10 +02:00
parent 7827b687fa
commit 231a2e95b9
9 changed files with 27 additions and 10 deletions

View File

@@ -159,7 +159,7 @@ const MyShares = () => {
onClick={() => {
if (window.isSecureContext) {
clipboard.copy(
`${appUrl}/share/${share.id}`
`${appUrl}/s/${share.id}`
);
toast.success(t("common.notify.copied"));
} else {

View File

@@ -132,7 +132,7 @@ const MyShares = () => {
onClick={() => {
if (window.isSecureContext) {
clipboard.copy(
`${config.get("general.appUrl")}/share/${
`${config.get("general.appUrl")}/s/${
share.id
}`
);

View File

@@ -0,0 +1,18 @@
import { GetServerSidePropsContext } from "next";
// Redirect to the share page
export function getServerSideProps(context: GetServerSidePropsContext) {
const { shareId } = context.params!;
return {
props: {},
redirect: {
permanent: false,
destination: "/share/" + shareId,
},
};
}
export default function ShareAlias() {
return null;
}