Skip to content

Commit

Permalink
Fix crash on unauthenticated view
Browse files Browse the repository at this point in the history
  • Loading branch information
MelissaAutumn committed Nov 7, 2024
1 parent ba8c630 commit 0edea64
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frontend/src/stores/user-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 0edea64

Please sign in to comment.