Skip to content

Commit

Permalink
fix: app_builder simplify match
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjackwills committed Feb 13, 2024
1 parent 83b95e8 commit e4afefc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
15 changes: 8 additions & 7 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ async fn main() -> Result<(), ()> {
std::process::exit(1);
}
Ok(app_state) => {
// TODO change this to just an Arc<ApplicationState>, and use a message bus everywhere?
let state = Arc::new(Mutex::new(app_state));
// TODO change this to just an Arc<ApplicationState>, and use a message bus everywhere?

let init_state = Arc::clone(&state);
let internal_state = Arc::clone(&state);
Expand All @@ -117,7 +117,7 @@ async fn main() -> Result<(), ()> {
let tray_sx = sx.clone();

#[allow(unused_variables)]
match tauri::Builder::default()
let app_builder = tauri::Builder::default()
.manage(state)
.setup(|app| {
#[cfg(debug_assertions)]
Expand Down Expand Up @@ -169,12 +169,13 @@ async fn main() -> Result<(), ()> {
.send(InternalMessage::Window(WindowVisibility::Show))
.ok();
}))
.build(tauri::generate_context!())
{
Ok(s) => {
.build(tauri::generate_context!());

match app_builder {
Ok(app) => {
tick_process(&init_state);
start_message_handler(&s, internal_state, rx, handler_sx);
s.run(move |_app, event| {
start_message_handler(&app, internal_state, rx, handler_sx);
app.run(move |_app, event| {
if let tauri::RunEvent::ExitRequested { api, .. } = event {
close_sx
.send(InternalMessage::Window(WindowVisibility::Hide))
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/src/window_action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ impl WindowAction {
window.center().ok();
}

/// Change from full screen to the standard window size
/// Change from full screen to the standard window size
fn _remove_fullscreen(window: &tauri::Window) {
window.set_resizable(true).ok();
window.set_fullscreen(false).ok();
Expand Down

0 comments on commit e4afefc

Please sign in to comment.