tui-realm 0.3.2

This commit is contained in:
veeso
2021-06-06 14:19:20 +02:00
parent 5670c0f975
commit 8cd91f6df3
9 changed files with 32 additions and 26 deletions

View File

@@ -36,16 +36,16 @@ use super::{
};
use crate::ui::keymap::*;
use tuirealm::components::InputPropsBuilder;
use tuirealm::{Msg, Payload, PropsBuilder, Value};
use tuirealm::{Msg, Payload, PropsBuilder, Update, Value};
// -- update
impl AuthActivity {
impl Update for AuthActivity {
/// ### update
///
/// Update auth activity model based on msg
/// The function exits when returns None
pub(super) fn update(&mut self, msg: Option<(String, Msg)>) -> Option<(String, Msg)> {
fn update(&mut self, msg: Option<(String, Msg)>) -> Option<(String, Msg)> {
let ref_msg: Option<(&str, &Msg)> = msg.as_ref().map(|(s, msg)| (s.as_str(), msg));
// Match msg
match ref_msg {
@@ -339,7 +339,9 @@ impl AuthActivity {
},
}
}
}
impl AuthActivity {
fn update_input_port(&mut self, port: u16) -> Option<(String, Msg)> {
match self.view.get_props(COMPONENT_INPUT_PORT) {
None => None,