mirror of
https://github.com/neosubhamoy/neodlp.git
synced 2026-03-22 06:55:51 +05:30
refactor: debug rust side opener command
This commit is contained in:
@@ -31,6 +31,7 @@ use tokio::{
|
|||||||
time::sleep,
|
time::sleep,
|
||||||
};
|
};
|
||||||
use tokio_tungstenite::accept_async;
|
use tokio_tungstenite::accept_async;
|
||||||
|
use log::{info, error};
|
||||||
|
|
||||||
struct ImageCache(StdMutex<HashMap<String, String>>);
|
struct ImageCache(StdMutex<HashMap<String, String>>);
|
||||||
|
|
||||||
@@ -361,17 +362,23 @@ async fn open_file_with_app(
|
|||||||
return app_handle
|
return app_handle
|
||||||
.opener()
|
.opener()
|
||||||
.reveal_item_in_dir(file_path)
|
.reveal_item_in_dir(file_path)
|
||||||
.map_err(|e| e.to_string());
|
.map_err(|e| {
|
||||||
|
error!("Failed to reveal file in explorer: {}", e);
|
||||||
|
e.to_string()
|
||||||
|
});
|
||||||
}
|
}
|
||||||
println!("Opening file: {} with app: {}", file_path, name);
|
info!("Opening file: {} with app: {}", file_path, name);
|
||||||
} else {
|
} else {
|
||||||
println!("Opening file: {} with default app", file_path);
|
info!("Opening file: {} with default app", file_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
app_handle
|
app_handle
|
||||||
.opener()
|
.opener()
|
||||||
.open_path(file_path, app_name)
|
.open_path(file_path, app_name)
|
||||||
.map_err(|e| e.to_string())
|
.map_err(|e| {
|
||||||
|
error!("Failed to open file: {}", e);
|
||||||
|
e.to_string()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
|
|||||||
Reference in New Issue
Block a user