Skip to content

Commit 3b09dcf

Browse files
committed
fix: #159
Signed-off-by: quexeky <[email protected]>
1 parent 2859a59 commit 3b09dcf

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

main/pages/settings/debug.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ platformInfo.value = currentPlatform;
116116
async function openDataDir() {
117117
if (!dataDir.value) return;
118118
try {
119-
await open(dataDir.value);
119+
await invoke("open_fs", { path: dataDir.value });
120120
} catch (error) {
121121
console.error("Failed to open data dir:", error);
122122
}
@@ -126,7 +126,7 @@ async function openLogFile() {
126126
if (!dataDir.value) return;
127127
try {
128128
const logPath = `${dataDir.value}/drop.log`;
129-
await open(logPath);
129+
await invoke("open_fs", { path: logPath });
130130
} catch (error) {
131131
console.error("Failed to open log file:", error);
132132
}

src-tauri/src/client.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use download_manager::DOWNLOAD_MANAGER;
55
use log::{debug, error};
66
use tauri::AppHandle;
77
use tauri_plugin_autostart::ManagerExt;
8+
use tauri_plugin_opener::OpenerExt;
89

910
use crate::AppState;
1011

@@ -72,3 +73,10 @@ pub fn get_autostart_enabled(app: AppHandle) -> Result<bool, tauri_plugin_autost
7273

7374
Ok(db_state)
7475
}
76+
77+
#[tauri::command]
78+
pub fn open_fs(path: String, app_handle: AppHandle) -> Result<(), tauri_plugin_opener::Error> {
79+
app_handle
80+
.opener()
81+
.open_path(path, None::<&str>)
82+
}

src-tauri/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ pub fn run() {
229229
fetch_state,
230230
quit,
231231
fetch_system_data,
232+
open_fs,
232233
// User utils
233234
update_settings,
234235
fetch_settings,

0 commit comments

Comments
 (0)