]> uap-core.de Git - note.git/commitdiff
remove unnecessary backend open_extern call in open_extern main
authorOlaf Wintermann <olaf.wintermann@gmail.com>
Tue, 28 Jul 2026 19:23:35 +0000 (21:23 +0200)
committerOlaf Wintermann <olaf.wintermann@gmail.com>
Tue, 28 Jul 2026 19:23:35 +0000 (21:23 +0200)
application/note/src/file.rs

index 077620ce338f2a9c6e144f4668568e7e8fcc07e3..d3f077943d4d1872fc59fc670aeca8225bf1103e 100644 (file)
@@ -149,28 +149,10 @@ impl FileNote {
             return;
         };
 
+        // The path should exist, because query_local_path is called when creating this object
         if let Some(path) = &self.local_path {
             println!("open file: {}", path.to_string_lossy());
             open_file(path.to_string_lossy().as_ref());
-        } else if let NoteId::Id(note_id) = self.id {
-            self.is_opening = true;
-            let proxy = doc.doc_proxy();
-            self.backend.open_extern(note_id, |result|{
-                proxy.call_mainthread(move |_doc, note|{
-                    note.is_opening = false;
-                    match result {
-                        OpenExternResult::Ok((path, istmp)) => {
-                            println!("open file: {}", path.to_string_lossy());
-                            open_file(path.to_string_lossy().as_ref());
-                            note.local_path = Some(path);
-                            note.is_tmp_file = istmp;
-                        }
-                        _ => {
-                            println!("open_extern failed");
-                        }
-                    }
-                });
-            });
         }
     }