diff options
author | Vika <vika@fireburn.ru> | 2024-09-04 22:15:32 +0300 |
---|---|---|
committer | Vika <vika@fireburn.ru> | 2024-09-04 22:15:32 +0300 |
commit | 406509dc549cb58d788a3dbd5572f28008c84546 (patch) | |
tree | aff6115c0bfbd12ca447503d6d850feccfd9ad89 /src/lib.rs | |
parent | f16cac2d35487b1772d1c2524ed223c779f45f23 (diff) | |
download | bowl-406509dc549cb58d788a3dbd5572f28008c84546.tar.zst |
Make LLM enhancements optional
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 |