From 0c8f99f4f58953334731cc195c385d31d8b0f695 Mon Sep 17 00:00:00 2001 From: jelemux Date: Thu, 4 Feb 2021 16:26:56 +0100 Subject: it works! --- src/view/main.rs | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'src/view/main.rs') 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), - GeneratedAddress(Irc
), - GeneratedTelephone(Irc), + 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!{ | + |n: Name| Msg::GeneratedName(n) ) /> @@ -395,7 +388,7 @@ impl Component for MainView { html!{ | + |a: Address| Msg::GeneratedAddress(a) ) /> @@ -408,7 +401,7 @@ impl Component for MainView { html!{ | + |t: Telephone| Msg::GeneratedTelephone(t) ) /> -- cgit v1.2.3