diff options
Diffstat (limited to 'src/view/telephone.rs')
-rw-r--r-- | src/view/telephone.rs | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/src/view/telephone.rs b/src/view/telephone.rs index 63fdee7..5db8ae1 100644 --- a/src/view/telephone.rs +++ b/src/view/telephone.rs @@ -1,7 +1,4 @@ use yew::prelude::*; -use yew::services::ConsoleService; -use yewtil::ptr::Irc; -use yewtil::ptr::Mrc; use yewtil::NeqAssign; use crate::view::WeakComponentLink; use crate::viewmodel::Error; @@ -25,7 +22,7 @@ use super::VCardPropertyInputComponent; /// ``` pub struct TelephoneView { props: Props, - value: Mrc<Telephone>, + value: Telephone, error: Option<Error>, } @@ -46,19 +43,13 @@ pub enum Msg { #[derive(Clone, PartialEq, Properties)] pub struct Props { - pub generated: Callback<Irc<Telephone>>, + pub generated: Callback<Telephone>, pub weak_link: WeakComponentLink<TelephoneView>, } impl VCardPropertyInputComponent<Telephone> for TelephoneView { fn get_input_object(&self) -> Telephone { - match self.value.irc().try_unwrap() { - Ok(telephone) => telephone, - Err(_) => { - ConsoleService::error("Couldn't unwrap telephone"); - Telephone::new() - }, - } + self.value.clone() } fn get_title(&self) -> String { "Telephone".to_string() @@ -75,7 +66,7 @@ impl Component for TelephoneView { props.weak_link.borrow_mut().replace(link); Self { props, - value: Mrc::new(Telephone::new()), + value: Telephone::new(), error: None, } } @@ -92,7 +83,7 @@ impl Component for TelephoneView { Msg::TogglePager => self.value.pager = !self.value.pager, Msg::ToggleTextPhone => self.value.text_phone = !self.value.text_phone, Msg::Generate => { - self.props.generated.emit(self.value.irc()); + self.props.generated.emit(self.value.clone()); } }; true |