diff options
author | jelemux <jeremias.weber@protonmail.com> | 2021-02-04 16:26:56 +0100 |
---|---|---|
committer | jelemux <jeremias.weber@protonmail.com> | 2021-02-04 16:26:56 +0100 |
commit | 0c8f99f4f58953334731cc195c385d31d8b0f695 (patch) | |
tree | 8d41d47ded008873b28a378fdbc74a9b0257dbf3 /src/view/main.rs | |
parent | 69ceb1f9ec68e41029759a6fcff3168adb6df373 (diff) | |
download | wasm-card-0c8f99f4f58953334731cc195c385d31d8b0f695.tar.gz wasm-card-0c8f99f4f58953334731cc195c385d31d8b0f695.tar.bz2 |
it works!
Diffstat (limited to 'src/view/main.rs')
-rw-r--r-- | src/view/main.rs | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/src/view/main.rs b/src/view/main.rs index b1c0dda..9b6a345 100644 --- a/src/view/main.rs +++ b/src/view/main.rs @@ -1,5 +1,4 @@ use yew::services::ConsoleService; -use yewtil::ptr::Irc; use crate::viewmodel::vcard::VCardData; use crate::viewmodel::Error; use crate::view::telephone::{self,TelephoneView}; @@ -44,9 +43,9 @@ pub enum Msg { ChangeDownloadOption(DownloadOption), Generate, - GeneratedName(Irc<Name>), - GeneratedAddress(Irc<Address>), - GeneratedTelephone(Irc<Telephone>), + GeneratedName(Name), + GeneratedAddress(Address), + GeneratedTelephone(Telephone), GenerationComplete, Nope, @@ -167,13 +166,7 @@ impl Component for MainView { self.answer_count = 0; - let vcard_data = match self.vcard_data.irc().try_unwrap() { - Ok(data) => data, - Err(err) => { - ConsoleService::error(&format!("Error when unwrapping VCardData: {:?}", err)); - VCardData::new() - }, - }; + let vcard_data = self.vcard_data.clone_inner(); let mut builder = VcardBuilder::new(); @@ -382,7 +375,7 @@ impl Component for MainView { html!{ <NameView weak_link=link generated=self.link.callback( - |n: Irc<Name>| + |n: Name| Msg::GeneratedName(n) ) /> @@ -395,7 +388,7 @@ impl Component for MainView { html!{ <AddressView weak_link=link generated=self.link.callback( - |a: Irc<Address>| + |a: Address| Msg::GeneratedAddress(a) ) /> @@ -408,7 +401,7 @@ impl Component for MainView { html!{ <TelephoneView weak_link=link generated=self.link.callback( - |t: Irc<Telephone>| + |t: Telephone| Msg::GeneratedTelephone(t) ) /> |