Fix(insert_modes): added the `Setup` insert mode as a workaround to log in until command based login is implemented
This commit is contained in:
parent
d447eb2312
commit
993ef6af89
|
@ -51,6 +51,9 @@ impl Event {
|
|||
State::Insert => main::handle_insert(app, event)
|
||||
.await
|
||||
.with_context(|| format!("Failed to handle input event: `{:#?}`", event)),
|
||||
State::Setup => setup::handle(app, event)
|
||||
.await
|
||||
.with_context(|| format!("Failed to handle input event: `{:#?}`", event)),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -81,6 +81,8 @@ impl App<'_> {
|
|||
self.init_account().await?;
|
||||
}
|
||||
|
||||
self.status.set_state(State::Normal);
|
||||
|
||||
loop {
|
||||
self.ui.update(&self.status).await?;
|
||||
|
||||
|
@ -100,6 +102,8 @@ impl App<'_> {
|
|||
async fn setup(&mut self) -> Result<()> {
|
||||
self.ui.setup_ui = Some(setup::UI::new());
|
||||
|
||||
self.status.set_state(State::Setup);
|
||||
|
||||
loop {
|
||||
self.ui.update_setup().await?;
|
||||
|
||||
|
|
|
@ -15,6 +15,8 @@ use matrix_sdk::{
|
|||
pub enum State {
|
||||
Normal,
|
||||
Insert,
|
||||
/// Temporary workaround until command based login is working
|
||||
Setup,
|
||||
}
|
||||
|
||||
pub struct Room {
|
||||
|
@ -41,6 +43,7 @@ impl fmt::Display for State {
|
|||
match self {
|
||||
Self::Normal => write!(f, "Normal"),
|
||||
Self::Insert => write!(f, "Insert"),
|
||||
Self::Setup => write!(f, "Setup (!! workaround !!)"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Reference in New Issue