Skip to content

Commit

Permalink
hotfix: fixing issue w/ wizard stalling tauri when opened in on_page_…
Browse files Browse the repository at this point in the history
…load (#177)
  • Loading branch information
a5huynh authored Aug 26, 2022
1 parent ab7c9b5 commit 9f10e0f
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions crates/tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
let rpc = tauri::async_runtime::block_on(rpc::RpcClient::new());
app.manage(Arc::new(Mutex::new(rpc)));
// Load user settings
app.manage(config);
app.manage(config.clone());
app.manage(Arc::new(PauseState::new(false)));

// Center window horizontally in the current screen
Expand All @@ -168,6 +168,14 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
}
});

if !config.user_settings.run_wizard {
window::show_wizard_window(&window.app_handle());
// Only run the wizard once.
let mut updated = config.user_settings.clone();
updated.run_wizard = true;
let _ = config.save_user_settings(&updated);
}

Ok(())
})
.on_window_event(|event| {
Expand Down Expand Up @@ -248,15 +256,6 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
}
Err(e) => window::alert(&window_clone, "Error registering global shortcut", &format!("{}", e))
}

if !config.user_settings.run_wizard {
window::show_wizard_window(&window.app_handle());
// Only run the wizard once.
let mut updated = config.user_settings.clone();
updated.run_wizard = true;
let _ = config.save_user_settings(&updated);
}

})
.run(ctx)
.expect("error while running tauri application");
Expand Down

0 comments on commit 9f10e0f

Please sign in to comment.