Skip to content

Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.

chore: set toggle default value

Nathan6bdaee3a002c
diff --git a/frontend/rust-lib/flowy-ai/src/local_ai/controller.rs b/frontend/rust-lib/flowy-ai/src/local_ai/controller.rs
index 6435b77fc3..1ec08854e0 100644
--- a/frontend/rust-lib/flowy-ai/src/local_ai/controller.rs
+++ b/frontend/rust-lib/flowy-ai/src/local_ai/controller.rs
@@ -314,7 +314,7 @@ impl LocalAIController {
std::thread::current().id()
);
return LocalAIPB {
- enabled: false,
+ enabled,
plugin_downloaded: false,
state: RunningStatePB::from(RunningState::ReadyToConnect),
lack_of_resource: None,
@@ -373,7 +373,8 @@ impl LocalAIController {
let workspace_id = self.user_service.workspace_id()?;
let key = local_ai_enabled_key(&workspace_id.to_string());
let store_preferences = self.upgrade_store_preferences()?;
- let enabled = !store_preferences.get_bool(&key).unwrap_or(true);
+ let enabled = !store_preferences.get_bool(&key).unwrap_or(false);
+ tracing::trace!("[AI Plugin] toggle local ai, enabled: {}", enabled,);
store_preferences.set_bool(&key, enabled)?;
self.toggle_plugin(enabled).await?;
Ok(enabled)