Skip to content

Commit a33ae8c

Browse files
committed
changed share to do /id or /history/id
(and it works now)
1 parent b76a6a0 commit a33ae8c

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

src/frontend/src/components/ShareEventButton.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@ export default defineComponent({
1414
methods: {
1515
copyLink() {
1616
const popupStore = usePopupStore();
17-
const baseUrl = window.location.host;
1817
19-
const urlToCopy = baseUrl + '/event/' + this.eventId;
18+
const urlToCopy = window.location.href;
2019
2120
try {
2221
navigator.clipboard.writeText(urlToCopy);

src/frontend/src/router/index.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ async function handleEventIdRedirects(
4242
if (isInPast) {
4343
return { path: `/history/${to.params.id}` };
4444
} else {
45-
return { path: `${to.params.id}` };
45+
return { path: `/${to.params.id}` };
4646
}
4747
}
4848

@@ -89,11 +89,6 @@ const router = createRouter({
8989
props: (route) => ({ id: Number(route.params.id) })
9090
}
9191
]
92-
},
93-
{
94-
path: '/event/:id',
95-
beforeEnter: handleEventIdRedirects,
96-
component: NoEventDetails // This never gets used but has to be here for the beforeEnter to be called
9792
}
9893
]
9994
});

0 commit comments

Comments
 (0)