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);