File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed
Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -93,19 +93,24 @@ pub fn highlight_in_folder<R: Runtime>(
9393}
9494
9595#[ tauri:: command]
96- pub fn open_path < R : Runtime > ( app : tauri:: AppHandle < R > , path : PathBuf ) {
97- if let Err ( e) = app. opener ( ) . open_path ( path. to_string_lossy ( ) , None :: < & str > )
98- {
99- tracing:: error!( "Failed to open path: {}" , e) ;
100- }
96+ pub async fn open_path < R : Runtime > ( app : tauri:: AppHandle < R > , path : PathBuf ) {
97+ tauri:: async_runtime:: spawn_blocking ( move || {
98+ if let Err ( e) =
99+ app. opener ( ) . open_path ( path. to_string_lossy ( ) , None :: < & str > )
100+ {
101+ tracing:: error!( "Failed to open path: {}" , e) ;
102+ }
103+ } )
104+ . await
105+ . ok ( ) ;
101106}
102107
103108#[ tauri:: command]
104- pub fn show_launcher_logs_folder < R : Runtime > ( app : tauri:: AppHandle < R > ) {
109+ pub async fn show_launcher_logs_folder < R : Runtime > ( app : tauri:: AppHandle < R > ) {
105110 let path = DirectoryInfo :: launcher_logs_dir ( ) . unwrap_or_default ( ) ;
106111 // failure to get folder just opens filesystem
107112 // (ie: if in debug mode only and launcher_logs never created)
108- open_path ( app, path) ;
113+ open_path ( app, path) . await ;
109114}
110115
111116// Get opening command
You can’t perform that action at this time.
0 commit comments