From 68d02f55a50f45ad0e05eee883cab0ccd3401ecb Mon Sep 17 00:00:00 2001 From: Jackson Goode Date: Fri, 27 Sep 2024 13:44:53 -0700 Subject: [PATCH] Fixup linting issue --- psst-gui/src/main.rs | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/psst-gui/src/main.rs b/psst-gui/src/main.rs index 650693e0..0e0bed1d 100644 --- a/psst-gui/src/main.rs +++ b/psst-gui/src/main.rs @@ -46,30 +46,29 @@ fn main() { paginated_limit, ) .install_as_global(); - - let delegate; - let launcher; - if state.config.has_credentials() { + let (delegate, launcher) = if state.config.has_credentials() { // Credentials are configured, open the main window. let window = ui::main_window(&state.config); - delegate = Delegate::with_main(window.id); - launcher = AppLauncher::with_window(window).configure_env(ui::theme::setup); + let delegate = Delegate::with_main(window.id); // Load user's local tracks for the WebApi. WebApi::global().load_local_tracks(state.config.username().unwrap()); - } else { - // No configured credentials, open the account setup. - let window = ui::account_setup_window(); - if state.config.kiosk_mode { - let window = ui::kiosk_setup_window(); + (delegate, AppLauncher::with_window(window)) + } else { + // No configured credentials, open the setup window. + let window = if state.config.kiosk_mode { + ui::kiosk_setup_window() } else { - } + ui::account_setup_window() + }; + let delegate = Delegate::with_preferences(window.id); - delegate = Delegate::with_preferences(window.id); - launcher = AppLauncher::with_window(window).configure_env(ui::theme::setup); + (delegate, AppLauncher::with_window(window)) }; + let launcher = launcher.configure_env(ui::theme::setup); + launcher .delegate(delegate) .launch(state)