diff options
Diffstat (limited to 'src/components/post_editor.rs')
-rw-r--r-- | src/components/post_editor.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/components/post_editor.rs b/src/components/post_editor.rs index 8c81b6b..f2268ad 100644 --- a/src/components/post_editor.rs +++ b/src/components/post_editor.rs @@ -115,7 +115,7 @@ pub enum Input<E: std::error::Error + std::fmt::Debug + Send + 'static> { #[relm4::component(pub)] impl<E: std::error::Error + std::fmt::Debug + Send + 'static> Component for PostEditor<E> { - type Init = Option<Post>; + type Init = (<components::SmartSummaryButton as relm4::Component>::Init, Option<Post>); type Output = Option<Post>; type Input = Input<E>; type CommandOutput = (); @@ -330,7 +330,11 @@ impl<E: std::error::Error + std::fmt::Debug + Send + 'static> Component for Post } } - fn init(init: Self::Init, root: Self::Root, sender: ComponentSender<Self>) -> ComponentParts<Self> { + fn init( + (http, init): Self::Init, + root: Self::Root, + sender: ComponentSender<Self> + ) -> ComponentParts<Self> { let mut model = Self { smart_summary_busy_guard: None, sending: false, @@ -356,7 +360,7 @@ impl<E: std::error::Error + std::fmt::Debug + Send + 'static> Component for Post wide_layout: gtk::GridLayout::new(), smart_summary: components::SmartSummaryButton::builder() - .launch(()) + .launch(http) .forward(sender.input_sender(), Input::SmartSummary), tracker: Default::default(), |