Skip to content

Commit

Permalink
fix: Fix build issue on non-macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
leoshimo committed Feb 16, 2024
1 parent 0e7ce72 commit fd0d2e5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion vrsjmp/src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ fn set_query(query: &str, state: tauri::State<State>) -> Vec<serde_json::Value>
#[tauri::command]
fn dispatch(form: &str, state: tauri::State<State>, app: tauri::AppHandle) {
let client = &state.client;
let window = app.get_window("main").unwrap();

// TODO: Make kwarg extraction more ergonomic (?)
let form_args = match Val::from(Form::from_expr(form).unwrap()) {
Expand All @@ -154,7 +153,11 @@ fn dispatch(form: &str, state: tauri::State<State>, app: tauri::AppHandle) {
error!("Error dispatching request - {e}");
}

let window = app.get_window("main").unwrap();
let _ = window.hide();

#[cfg(target_os = "macos")]
let _ = app.hide();
}

fn main() -> Result<()> {
Expand Down Expand Up @@ -185,7 +188,9 @@ fn main() -> Result<()> {
.is_visible()
.expect("should retrieve window visibility");
if visible {
#[cfg(target_os = "macos")]
let _ = handle.hide();
let _ = window.hide();
} else {
let _ = window.set_focus();
}
Expand Down

0 comments on commit fd0d2e5

Please sign in to comment.