diff --git a/memento-note/components/note-attachments.tsx b/memento-note/components/note-attachments.tsx index 5644fcb..f5dfff3 100644 --- a/memento-note/components/note-attachments.tsx +++ b/memento-note/components/note-attachments.tsx @@ -73,8 +73,11 @@ export function NoteAttachments({ noteId, onOpenDocQA, onCountChange, triggerUpl } }, [attachments, fetchAttachments]) + const lastTriggerRef = useRef(0) + useEffect(() => { - if (triggerUpload && triggerUpload > 0) { + if (triggerUpload && triggerUpload > lastTriggerRef.current) { + lastTriggerRef.current = triggerUpload if (attachments.length > 0) { sectionRef.current?.scrollIntoView({ behavior: 'smooth', block: 'center' }) } diff --git a/memento-note/prisma/schema.prisma b/memento-note/prisma/schema.prisma index 6106375..61c2115 100644 --- a/memento-note/prisma/schema.prisma +++ b/memento-note/prisma/schema.prisma @@ -683,6 +683,7 @@ model DocumentChunk { startChar Int? endChar Int? metadata String? + embedding Unsupported("vector(1536)")? createdAt DateTime @default(now()) attachment NoteAttachment @relation(fields: [attachmentId], references: [id], onDelete: Cascade)