fix: devtools command compatibility + add devtools feature flag
This commit is contained in:
@ -13,7 +13,7 @@ crate-type = ["staticlib", "cdylib", "rlib"]
|
||||
tauri-build = { version = "2", features = [] }
|
||||
|
||||
[dependencies]
|
||||
tauri = { version = "2", features = ["protocol-asset"] }
|
||||
tauri = { version = "2", features = ["protocol-asset", "devtools"] }
|
||||
tauri-plugin-opener = "2"
|
||||
tauri-plugin-dialog = "2"
|
||||
tauri-plugin-fs = "2"
|
||||
|
||||
@ -2,9 +2,5 @@ use tauri::{command, Webview};
|
||||
|
||||
#[command]
|
||||
pub async fn toggle_devtools(webview: Webview) {
|
||||
if webview.is_devtools_open() {
|
||||
webview.close_devtools();
|
||||
} else {
|
||||
webview.open_devtools();
|
||||
}
|
||||
webview.open_devtools();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user