Join rooms from "join room" overlay

This commit is contained in:
Joscha 2022-02-26 14:13:08 +01:00
parent 1949b6f5e1
commit 1543940fbc
3 changed files with 44 additions and 14 deletions

View file

@ -6,6 +6,7 @@ mod ui;
use std::io;
use config::Config;
use crossterm::event::{DisableMouseCapture, EnableMouseCapture};
use crossterm::execute;
use crossterm::terminal::{EnterAlternateScreen, LeaveAlternateScreen};
@ -15,6 +16,8 @@ use ui::Ui;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let config = Box::leak(Box::new(Config::load()));
let mut terminal = Terminal::new(CrosstermBackend::new(io::stdout()))?;
crossterm::terminal::enable_raw_mode()?;
@ -25,7 +28,7 @@ async fn main() -> anyhow::Result<()> {
)?;
// Defer error handling so the terminal always gets restored properly
let result = Ui::run(&mut terminal).await;
let result = Ui::run(config, &mut terminal).await;
execute!(
terminal.backend_mut(),