From 0edea6402dd3a35701da049b28b9af7c2f59f945 Mon Sep 17 00:00:00 2001 From: Melissa Autumn Date: Thu, 7 Nov 2024 08:12:06 -0800 Subject: [PATCH] Fix crash on unauthenticated view --- frontend/src/stores/user-store.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/stores/user-store.ts b/frontend/src/stores/user-store.ts index ac1cc0f03..05c3f3528 100644 --- a/frontend/src/stores/user-store.ts +++ b/frontend/src/stores/user-store.ts @@ -42,8 +42,8 @@ export const useUserStore = defineStore('user', () => { * Return the last unique URL part of the users link */ const mySlug = computed((): string => { - const link = myLink.value.replace(/\/+$/, ''); - return link.slice(link.lastIndexOf('/')+1); + const link = myLink?.value?.replace(/\/+$/, ''); + return link?.slice(link.lastIndexOf('/') + 1); }); const authenticated = computed((): boolean => data.value.accessToken !== null);