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/address.rs | |
parent | 3f0892368bcf475fdae39f24ef51b82b3013535f (diff) | |
download | wasm-card-94a0e361e180223adf2bc9760c8810dfa3c2681f.tar.gz wasm-card-94a0e361e180223adf2bc9760c8810dfa3c2681f.tar.bz2 |
use different vcard library
Diffstat (limited to 'src/view/address.rs')
-rw-r--r-- | src/view/address.rs | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/src/view/address.rs b/src/view/address.rs index b833518..23b697a 100644 --- a/src/view/address.rs +++ b/src/view/address.rs @@ -1,11 +1,11 @@ use super::WeakComponentLink; use yew::prelude::*; -use vcard::properties; use crate::viewmodel::address::*; use crate::viewmodel::VCardPropertyInputObject; use super::VCardPropertyInputComponent; use crate::viewmodel::Error; + pub struct AddressView { props: Props, value: Address, @@ -28,11 +28,11 @@ pub enum Msg { #[derive(Clone, PartialEq, Properties)] pub struct Props { - pub generated: Callback<Result<properties::Address,()>>, + pub generated: Callback<Address>, pub weak_link: WeakComponentLink<AddressView>, } -impl VCardPropertyInputComponent<properties::Address, Address> for AddressView { +impl VCardPropertyInputComponent<Address> for AddressView { fn get_input_object(&self) -> Address { self.value.clone() } @@ -67,16 +67,7 @@ impl Component for AddressView { Msg::ToggleWork => self.value.work = !self.value.work, Msg::ToggleHome => self.value.home = !self.value.home, Generate => { - match self.value.to_vcard_property() { - Ok(address) => { - self.props.generated.emit(Ok(address)); - return false; - }, - Err(error) => { - self.props.generated.emit(Err(())); - self.error = Some(error); - }, - }; + self.props.generated.emit(self.value); }, }; true |