Skip to content

Commit 0e0e6df

Browse files
committed
add access rights check to sidebar
1 parent 4f2b6a4 commit 0e0e6df

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/presentation/pages/Note.vue

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@
4444
</div>
4545
<div v-else>
4646
<PageBlock>
47-
<template #left>
47+
<template
48+
v-if="user"
49+
#left
50+
>
4851
<VerticalMenu
4952
class="menu"
5053
:items="[verticalMenuItems]"
@@ -78,6 +81,7 @@ import NoteHeader from '@/presentation/components/note-header/NoteHeader.vue';
7881
import BreadCrumbs from '@/presentation/components/breadcrumbs/BreadCrumbs.vue';
7982
import { NoteHierarchy } from '@/domain/entities/NoteHierarchy';
8083
import { getTimeFromNow } from '@/infrastructure/utils/date.ts';
84+
import { useAppState } from '@/application/services/useAppState';
8185
8286
const { t } = useI18n();
8387
@@ -97,6 +101,8 @@ const props = defineProps<{
97101
parentId?: string;
98102
}>();
99103
104+
const { user } = useAppState();
105+
100106
const noteId = toRef(props, 'id');
101107
102108
const { note, noteTools, save, noteTitle, canEdit, noteParents, noteHierarchy } = useNote({
@@ -194,7 +200,7 @@ function transformNoteHierarchy(noteHierarchyObj: NoteHierarchy | null, currentN
194200
195201
// Transform the current note into a VerticalMenuItem
196202
return {
197-
title: noteHierarchyObj?.noteTitle || 'Untitled',
203+
title: noteHierarchyObj.noteTitle || 'Untitled',
198204
isActive: route.path === `/note/${noteHierarchyObj.noteId}`,
199205
items: noteHierarchyObj.childNotes ? noteHierarchyObj.childNotes.map(child => transformNoteHierarchy(child, currentNoteTitle)) : undefined,
200206
onActivate: () => {

0 commit comments

Comments
 (0)