This commit is contained in:
Timothy Jaeryang Baek
2026-07-15 23:51:37 -04:00
parent 0dc93b8ae7
commit 2b8ef9340e
2 changed files with 11 additions and 3 deletions
+9 -1
View File
@@ -579,9 +579,17 @@ async def update_note_by_id(
pinned_note_ids = await Notes.get_pinned_note_ids(user.id, db=db)
note.is_pinned = note.id in pinned_note_ids
event_data = note.model_dump()
if form_data.data is not None:
event_data['data'] = {
key: note.data.get(key)
for key in form_data.data.keys()
if note.data is not None and key in note.data
}
await sio.emit(
'events:note',
note.model_dump(),
event_data,
to=f'note:{note.id}',
)
@@ -150,9 +150,9 @@ export const Image = Node.create<ImageOptions>({
img.setAttribute('title', node.attrs.title || '');
img.addEventListener('data', (e) => {
const files = e?.files || [];
const files = e?.files || editor.storage?.files || [];
if (files && node.attrs.src.startsWith('data://')) {
const file = editorFiles.find((f) => f.id === fileId);
const file = files.find((f) => f.id === fileId);
if (file) {
img.setAttribute('src', safeImageUrl(file.url || ''));
} else {