display client info and unlock errors to user

This commit is contained in:
Joseph Montanaro
2022-12-21 13:42:12 -08:00
parent 69475604c0
commit 50f0985f4f
8 changed files with 95 additions and 27 deletions

View File

@ -3,14 +3,17 @@
windows_subsystem = "windows"
)]
use std::str::FromStr;
use tauri::Manager;
mod config;
mod errors;
mod clientinfo;
mod ipc;
mod state;
mod server;
use state::AppState;
fn main() {
let initial_state = match state::AppState::new() {
@ -27,7 +30,9 @@ fn main() {
ipc::save_credentials,
])
.setup(|app| {
let addr = std::net::SocketAddrV4::from_str("127.0.0.1:12345").unwrap();
let state = app.state::<AppState>();
let config = state.config.read().unwrap();
let addr = std::net::SocketAddrV4::new(config.listen_addr, config.listen_port);
tauri::async_runtime::spawn(server::serve(addr, app.handle()));
Ok(())
})