Switch euph::Room to use euphoxide's Instance
This commit is contained in:
parent
b94dfbdc31
commit
8dd5db5888
5 changed files with 408 additions and 640 deletions
|
|
@ -1,9 +1,9 @@
|
|||
use crossterm::style::{ContentStyle, Stylize};
|
||||
use euphoxide::api::PersonalAccountView;
|
||||
use euphoxide::conn::State as ConnState;
|
||||
use euphoxide::conn;
|
||||
use toss::terminal::Terminal;
|
||||
|
||||
use crate::euph::Room;
|
||||
use crate::euph::{self, Room};
|
||||
use crate::ui::input::{key, InputEvent, KeyBindingsList};
|
||||
use crate::ui::util;
|
||||
use crate::ui::widgets::editor::EditorState;
|
||||
|
|
@ -14,8 +14,6 @@ use crate::ui::widgets::resize::Resize;
|
|||
use crate::ui::widgets::text::Text;
|
||||
use crate::ui::widgets::BoxedWidget;
|
||||
|
||||
use super::room::RoomState;
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
enum Focus {
|
||||
Email,
|
||||
|
|
@ -97,8 +95,8 @@ impl AccountUiState {
|
|||
}
|
||||
|
||||
/// Returns `false` if the account UI should not be displayed any longer.
|
||||
pub fn stabilize(&mut self, state: &RoomState) -> bool {
|
||||
if let RoomState::Connected(ConnState::Joined(state)) = state {
|
||||
pub fn stabilize(&mut self, state: Option<&euph::State>) -> bool {
|
||||
if let Some(euph::State::Connected(_, conn::State::Joined(state))) = state {
|
||||
match (&self, &state.account) {
|
||||
(Self::LoggedOut(_), Some(view)) => *self = Self::LoggedIn(LoggedIn(view.clone())),
|
||||
(Self::LoggedIn(_), None) => *self = Self::LoggedOut(LoggedOut::new()),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue