]> uap-core.de Git - note.git/commitdiff
remove unused load_note method
authorOlaf Wintermann <olaf.wintermann@gmail.com>
Sat, 30 May 2026 21:39:42 +0000 (23:39 +0200)
committerOlaf Wintermann <olaf.wintermann@gmail.com>
Sat, 30 May 2026 21:39:42 +0000 (23:39 +0200)
application/src/notebook.rs

index 917e09a7df78b569d73bc255f9ee3580ace00a66..96933193fa11082ed0ee3578ea71b2c3de76be9c 100644 (file)
@@ -114,41 +114,6 @@ impl Notebook {
         }
     }
 
-    pub fn load_note(&self, note: &entity::note::Model) -> UiDoc<crate::note::Note> {
-        // Create the new note
-        let note_data = crate::note::Note::new(self.collection_id, self.backend.clone());
-
-        // Create the note document object
-        UiDoc::new2(note_data, |n,d| {
-            // TODO: remove this when toolkit is not that buggy
-            //       for some reason we have to attach the doc first, before we can
-            //       set the text
-            if let Some(mut nb) = self.doc_ref.get_doc() {
-                nb.ctx.attach(&d);
-            }
-
-            n.init_from_model(note);
-
-            let proxy = d.doc_proxy();
-            self.backend.get_note_content(note.note_id, move|result|{
-                proxy.call_mainthread(|doc, note|{
-                    match result {
-                        Ok(content) => {
-                            if let Some(content) = content {
-                                note.init_content(&content);
-                            } else {
-                                println!("note {}: no content", note.note_id);
-                            }
-                        },
-                        Err(e) => {
-                            println!("Cannot get note content: {}", e);
-                        }
-                    }
-                });
-            });
-        })
-    }
-
     #[action]
     pub fn message(&mut self, _event: &ActionEvent) {
         while let Ok(msg) = self.broadcast_rx.try_recv() {