From 94a0e361e180223adf2bc9760c8810dfa3c2681f Mon Sep 17 00:00:00 2001 From: jelemux Date: Thu, 28 Jan 2021 22:24:32 +0100 Subject: use different vcard library --- src/view/address.rs | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'src/view/address.rs') 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>, + pub generated: Callback
, pub weak_link: WeakComponentLink, } -impl VCardPropertyInputComponent for AddressView { +impl VCardPropertyInputComponent
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 -- cgit v1.2.3