mirror of
https://github.com/spacedriveapp/spacedrive.git
synced 2026-10-27 11:28:49 -04:00
Add compiler checks for dev tools in production
This commit is contained in:
1 parent
d18180993c
commit
d5abb4a654
1 file changed
+12
-2
@@ -72,20 +72,27 @@ fn custom_menu_bar() -> Menu {
|
||||
}
|
||||
|
||||
pub(crate) fn handle_menu_event(event: WindowMenuEvent<Wry>) {
|
||||
let window = event.window();
|
||||
match event.menu_item_id() {
|
||||
"quit" => {
|
||||
std::process::exit(0);
|
||||
}
|
||||
"close" => {
|
||||
let window = event.window();
|
||||
|
||||
#[cfg(debug_assertions)]
|
||||
if window.is_devtools_open() {
|
||||
window.close_devtools();
|
||||
return;
|
||||
} else {
|
||||
window.close().unwrap();
|
||||
}
|
||||
|
||||
#[cfg(not(debug_assertions))]
|
||||
window.close().unwrap();
|
||||
}
|
||||
"reload_app" => {
|
||||
window
|
||||
event
|
||||
.window()
|
||||
.with_webview(|webview| {
|
||||
#[cfg(target_os = "macos")]
|
||||
unsafe {
|
||||
@@ -95,7 +102,10 @@ pub(crate) fn handle_menu_event(event: WindowMenuEvent<Wry>) {
|
||||
})
|
||||
.unwrap();
|
||||
}
|
||||
#[cfg(debug_assertions)]
|
||||
"toggle_devtools" => {
|
||||
let window = event.window();
|
||||
|
||||
if window.is_devtools_open() {
|
||||
window.close_devtools();
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user