2023-06-14 21:49:20 +00:00
|
|
|
mod ui;
|
2023-06-15 17:19:24 +00:00
|
|
|
mod accounts;
|
2023-06-15 22:15:07 +00:00
|
|
|
mod app;
|
2023-06-14 21:49:20 +00:00
|
|
|
|
2023-07-01 10:44:11 +00:00
|
|
|
use cli_log::{error, warn, info};
|
2023-06-14 21:49:20 +00:00
|
|
|
|
2023-06-15 17:19:24 +00:00
|
|
|
#[tokio::main]
|
|
|
|
async fn main() -> anyhow::Result<()> {
|
2023-07-01 10:44:11 +00:00
|
|
|
cli_log::init_cli_log!();
|
2023-06-15 17:19:24 +00:00
|
|
|
|
2023-06-15 22:15:07 +00:00
|
|
|
let mut app = app::App::new();
|
2023-06-23 03:41:26 +00:00
|
|
|
app.fill_test_data();
|
2023-06-15 19:57:43 +00:00
|
|
|
|
2023-07-01 10:44:11 +00:00
|
|
|
let mut ui = ui::UI::new();
|
2023-06-29 10:36:16 +00:00
|
|
|
if app.accounts_manager.num_accounts() == 0 {
|
2023-06-29 18:17:54 +00:00
|
|
|
info!("No saved sessions found -> jumping into setup");
|
2023-06-29 10:36:16 +00:00
|
|
|
ui.setup(&mut app).await?;
|
|
|
|
}
|
2023-06-15 19:57:43 +00:00
|
|
|
|
2023-06-29 10:36:16 +00:00
|
|
|
ui.main(&mut app).await?;
|
2023-06-14 21:49:20 +00:00
|
|
|
|
|
|
|
Ok(())
|
|
|
|
}
|