1
0
Fork 0

Link to stickerbuild with uuid.

This commit is contained in:
Brian D 2024-12-04 17:09:57 -05:00
parent 438cae7386
commit 1c502e7eee
2 changed files with 6 additions and 3 deletions

View file

@ -10,6 +10,8 @@ import StickerView from '../views/StickerView.vue'
import WelcomeView from '../views/WelcomeView.vue'
const uuid: string = ':uuid([0-9A-F]{8}-[0-9A-F]{4}-[4][0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12})'
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
routes: [
@ -43,7 +45,8 @@ const router = createRouter({
title: 'Sticker Builder',
},
name: 'stickerbuilder',
path: '/stickerbuilder',
path: `/stickerbuilder/${uuid}`,
// TODO: Consider using /:uuid/edit
},
{
component: StickerView,
@ -51,7 +54,7 @@ const router = createRouter({
title: 'Sticker',
},
name: 'sticker',
path: '/:uuid([0-9A-F]{8}-[0-9A-F]{4}-[4][0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12})',
path: `/${uuid}`,
},
{
component: LoginView,

View file

@ -76,7 +76,7 @@ function claimSticker() {
</span>
<Button
as="router-link"
to="/stickerbuilder"
:to="{ name: 'stickerbuilder', params: { uuid: stickersStore.activeSticker }}"
v-bind:disabled="sessionStore.isAnonymous"
v-if="sticker?.owner == sessionStore.user.username">
Customize my sticker!