mirror of
https://github.com/storytold/figcraft.git
synced 2026-10-28 04:16:46 -06:00
#1314: refuse saving over the file only when save_to has a path (main's download has none)
This commit is contained in:
@@ -900,7 +900,10 @@ fn save_to(s: &mut Session, path: Option<String>) -> Result<Value> {
|
||||
}
|
||||
let i = crate::branches::file_tab(s);
|
||||
let ds = s.docs.get_mut(i).ok_or(EngineError::NoDocument)?;
|
||||
refuse_dropping_images(ds, &path)?;
|
||||
// A download (no path) writes over no file.
|
||||
if let Some(path) = path.as_deref() {
|
||||
refuse_dropping_images(ds, path)?;
|
||||
}
|
||||
let mut snapshot = FileSnapshot::of(ds);
|
||||
let follows_path = ds.path.as_deref().map_or(ds.doc.name == "Untitled", |old| ds.doc.name == file_stem(old));
|
||||
if let Some(path) = path.as_deref()
|
||||
|
||||
Reference in New Issue
Block a user