fix(core/dialog): reconstruct path using appropriate separator (#820)

* fix(core/dialog): reconstruct path using appropriate separator

ref: tauri-apps/tauri#8074

* Reference original issue [skip ci]
This commit is contained in:
Amr Bashir
2023-12-19 02:09:04 +02:00
committed by GitHub
parent 2d6bfbfacf
commit b1c6a7885e
3 changed files with 34 additions and 27 deletions
+2
View File
@@ -71,6 +71,8 @@ fn set_default_path<R: Runtime>(
mut dialog_builder: FileDialogBuilder<R>,
default_path: PathBuf,
) -> FileDialogBuilder<R> {
// we need to adjust the separator on Windows: https://github.com/tauri-apps/tauri/issues/8074
let default_path: PathBuf = default_path.components().collect();
if default_path.is_file() || !default_path.exists() {
if let (Some(parent), Some(file_name)) = (default_path.parent(), default_path.file_name()) {
if parent.components().count() > 0 {