diff --git a/src/components/TaskEditor.tsx b/src/components/TaskEditor.tsx index 0f11857..0797d10 100644 --- a/src/components/TaskEditor.tsx +++ b/src/components/TaskEditor.tsx @@ -117,14 +117,6 @@ export const TaskEditor: Component = (props) => { } }); - // Make editor react to editable changes - createEffect(() => { - const e = editor(); - if (e && props.editable !== undefined) { - e.setEditable(props.editable); - } - }); - return ( <>
pb.authStore.model?.id; + const currentUserId = pb.authStore.model?.id; // Derived states const activeNote = createMemo(() => { @@ -159,8 +159,8 @@ export const NotepadView: Component<{
}> {(note) => { - const isOwner = () => note().user === currentUserId(); - const canEdit = () => isOwner() || !note().isPrivate; + const isOwner = note().user === currentUserId; + const canEdit = isOwner || !note().isPrivate; return ( <> @@ -180,14 +180,14 @@ export const NotepadView: Component<{ class="text-3xl sm:text-4xl font-black tracking-tight bg-transparent border-none outline-none focus:ring-0 flex-1 placeholder:text-muted-foreground/30 px-0 min-w-0" value={note().title} placeholder="Note Title" - readOnly={!canEdit()} + readOnly={!canEdit} onBlur={(e) => { const val = e.currentTarget.value.trim() || 'Untitled'; if (val !== note().title) handleRenameNote(note().id, note().title, val); }} />
- +