Enabling frontend dev tools (#1420)

This commit is contained in:
Ericson "Fogo" Soares 2023-10-03 00:54:46 -03:00 committed by GitHub
parent bd7788f816
commit e081cfead8
3 changed files with 11 additions and 2 deletions

3
.vscode/launch.json vendored
View File

@ -17,7 +17,8 @@
"problemMatcher": "$rustc" "problemMatcher": "$rustc"
}, },
"env": { "env": {
"RUST_BACKTRACE": "short" "RUST_BACKTRACE": "short",
"SD_DEVTOOLS": "true"
// "RUST_LOG": "sd_core::invalidate-query=trace" // "RUST_LOG": "sd_core::invalidate-query=trace"
}, },
"sourceLanguages": ["rust"], "sourceLanguages": ["rust"],

3
.vscode/tasks.json vendored
View File

@ -52,7 +52,8 @@
"--no-default-features" "--no-default-features"
], ],
"env": { "env": {
"RUST_BACKTRACE": "short" "RUST_BACKTRACE": "short",
"SD_DEVTOOLS": "true"
// "RUST_LOG": "sd_core::invalidate-query=trace" // "RUST_LOG": "sd_core::invalidate-query=trace"
}, },
"problemMatcher": ["$rustc"], "problemMatcher": ["$rustc"],

View File

@ -155,6 +155,13 @@ async fn main() -> tauri::Result<()> {
} }
}); });
#[cfg(debug_assertions)]
{
if std::env::var("SD_DEVTOOLS").is_ok() {
window.open_devtools();
}
}
#[cfg(target_os = "windows")] #[cfg(target_os = "windows")]
window.set_decorations(true).unwrap(); window.set_decorations(true).unwrap();