summaryrefslogtreecommitdiff
path: root/src/view/telephone.rs
diff options
context:
space:
mode:
authorjelemux <jeremias.weber@protonmail.com>2021-01-28 22:24:32 +0100
committerjelemux <jeremias.weber@protonmail.com>2021-01-28 22:24:32 +0100
commit94a0e361e180223adf2bc9760c8810dfa3c2681f (patch)
treed29de5300d0ff0ba636f48eca8df43bb5256b49c /src/view/telephone.rs
parent3f0892368bcf475fdae39f24ef51b82b3013535f (diff)
downloadwasm-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.rs16
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