mirror of
https://github.com/storytold/figcraft.git
synced 2026-11-07 11:03:15 +00:00
fix(ui): write a plugin's offered file through the confined file helper (#1960)
This commit is contained in:
1 parent
bcc611b3a9
commit
c1dfa9ecee
1 file changed
+1
-1
@@ -138,7 +138,7 @@ pub(crate) fn save_file(app: &mut FigApp, data: &Value) {
|
||||
let shown = name.clone();
|
||||
app.pick_save(tr("Save file"), &name, &exts, move |app, path| {
|
||||
let file = path.file_name().map(|f| f.to_string_lossy().to_string()).unwrap_or(shown);
|
||||
match std::fs::write(&path, &bytes) {
|
||||
match figcraft_engine::file_access::write(&path, &bytes) {
|
||||
Ok(()) => app.toast(trf("Saved {name}", &[("name", &file)])),
|
||||
Err(_) => app.toast(tr("Couldn't save the file")),
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user