diff options
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/lib.rs b/src/lib.rs index 6421560..37b54a5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,7 +4,9 @@ use libsecret::prelude::{RetrievableExtManual, RetrievableExt}; use relm4::{actions::{RelmAction, RelmActionGroup}, gtk, loading_widgets::LoadingWidgets, prelude::{AsyncComponent, AsyncComponentController, AsyncComponentParts, AsyncController, ComponentController, Controller}, AsyncComponentSender, Component, RelmWidgetExt}; pub mod components { + #[cfg(feature = "smart-summary")] pub(crate) mod smart_summary; + #[cfg(feature = "smart-summary")] pub(crate) use smart_summary::{ SmartSummaryButton, Output as SmartSummaryOutput, Input as SmartSummaryInput }; @@ -257,9 +259,16 @@ impl AsyncComponent for App { micropub: state, secret_schema, - post_editor: components::PostEditor::builder() - .launch((http.clone(), None)) - .forward(sender.input_sender(), Self::Input::PostEditor), + post_editor: { + #[cfg(feature = "smart-summary")] + let init = (http.clone(), None); + #[cfg(not(feature = "smart-summary"))] + let init = None; + + components::PostEditor::builder() + .launch(init) + .forward(sender.input_sender(), Self::Input::PostEditor) + }, signin: components::SignIn::builder() .launch((glib::Uri::parse( CLIENT_ID_STR, glib::UriFlags::NONE |