]> uap-core.de Git - note.git/commitdiff
reload attachment list when a new attachment is added main
authorOlaf Wintermann <olaf.wintermann@gmail.com>
Mon, 31 Aug 2026 19:25:26 +0000 (21:25 +0200)
committerOlaf Wintermann <olaf.wintermann@gmail.com>
Mon, 31 Aug 2026 19:25:26 +0000 (21:25 +0200)
application/note/src/note.rs

index 87acdc7cf1e0ad784fd682b59cd70c48dcff5527..4ee6d088b71441b58623297006f90eeb64ada28c 100644 (file)
@@ -578,10 +578,12 @@ impl Note {
             if let EventType::FileList(file_selection) = event.event_type && let Some(file) = file_selection.get(0) {
                 let path = Path::new(file);
                 backend.add_note_attachment(note_id, path, move|result|{
-                    proxy.call_mainthread(|_doc, _note|{
+                    proxy.call_mainthread(|_doc, note|{
                         match result {
                             Ok((attachment, content)) => {
                                 println!("attachment: {} id: {}", attachment.attachment_id, content.attachment_id);
+                                // reload attachments
+                                note.load_attachments();
                             },
                             Err(e) => {
                                 println!("cannot add attachment: {}", e);