diff options
author | jelemux <jeremias.weber@protonmail.com> | 2021-01-28 22:24:32 +0100 |
---|---|---|
committer | jelemux <jeremias.weber@protonmail.com> | 2021-01-28 22:24:32 +0100 |
commit | 94a0e361e180223adf2bc9760c8810dfa3c2681f (patch) | |
tree | d29de5300d0ff0ba636f48eca8df43bb5256b49c /src/view/telephone.rs | |
parent | 3f0892368bcf475fdae39f24ef51b82b3013535f (diff) | |
download | wasm-card-94a0e361e180223adf2bc9760c8810dfa3c2681f.tar.gz wasm-card-94a0e361e180223adf2bc9760c8810dfa3c2681f.tar.bz2 |
use different vcard library
Diffstat (limited to 'src/view/telephone.rs')
-rw-r--r-- | src/view/telephone.rs | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/src/view/telephone.rs b/src/view/telephone.rs index a47c610..26d7806 100644 --- a/src/view/telephone.rs +++ b/src/view/telephone.rs @@ -1,7 +1,6 @@ use crate::view::WeakComponentLink; use crate::viewmodel::Error; use yew::prelude::*; -use vcard::properties; use crate::viewmodel::telephone::*; use crate::viewmodel::VCardPropertyInputObject; use super::VCardPropertyInputComponent; @@ -30,11 +29,11 @@ pub enum Msg { #[derive(Clone, PartialEq, Properties)] pub struct Props { - pub generated: Callback<Result<properties::Telephone,()>>, + pub generated: Callback<Telephone>, pub weak_link: WeakComponentLink<TelephoneView>, } -impl VCardPropertyInputComponent<properties::Telephone, Telephone> for TelephoneView { +impl VCardPropertyInputComponent<Telephone> for TelephoneView { fn get_input_object(&self) -> Telephone { self.value.clone() } @@ -71,16 +70,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 => { - match self.value.to_vcard_property() { - Ok(telephone) => { - self.props.generated.emit(Ok(telephone)); - return false; - }, - Err(error) => { - self.props.generated.emit(Err(())); - self.error = Some(error); - }, - }; + self.props.generated.emit(self.value); } }; true |