Skip to content

Commit 7012c01

Browse files
committed
Refactor open_devtools command to simplify the implementation by directly calling open_devtools on the webview window, improving code clarity.
1 parent 5081923 commit 7012c01

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src-tauri/src/command/cmds.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,7 @@ pub async fn open_url(_: tauri::AppHandle, url: String) {
142142
// open devtools
143143
#[tauri::command]
144144
pub async fn open_devtools(handle: AppHandle) {
145-
if let Some(_) = handle.get_webview_window("main") {
146-
println!("open devtools");
147-
// existing_window.open_devtools();
148-
}
145+
let _ = handle.get_webview_window("main").unwrap().open_devtools();
149146
}
150147

151148
#[tauri::command]

0 commit comments

Comments
 (0)