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: enable index on mobile (#7954)

Nathan.foood80d0285f913
diff --git a/frontend/rust-lib/collab-integrate/src/collab_builder.rs b/frontend/rust-lib/collab-integrate/src/collab_builder.rs
index 5af621e7eb..ba5b833434 100644
--- a/frontend/rust-lib/collab-integrate/src/collab_builder.rs
+++ b/frontend/rust-lib/collab-integrate/src/collab_builder.rs
@@ -35,7 +35,6 @@ use collab_user::core::{UserAwareness, UserAwarenessNotifier};
use crate::instant_indexed_data_provider::InstantIndexedDataWriter;
use flowy_error::FlowyError;
-use lib_infra::util::get_operating_system;
use lib_infra::{if_native, if_wasm};
use tracing::{error, instrument, trace, warn};
use uuid::Uuid;
@@ -311,18 +310,16 @@ impl AppFlowyCollabBuilder {
where
T: BorrowMut<Collab> + Send + Sync + 'static,
{
- if get_operating_system().is_desktop() {
- let cloned_object = object.clone();
- let weak_collab = Arc::downgrade(&collab);
- let weak_embedding_writer = self.embeddings_writer.clone();
- tokio::spawn(async move {
- if let Some(embedding_writer) = weak_embedding_writer.and_then(|w| w.upgrade()) {
- embedding_writer
- .queue_collab_embed(cloned_object, weak_collab)
- .await;
- }
- });
- }
+ let cloned_object = object.clone();
+ let weak_collab = Arc::downgrade(&collab);
+ let weak_embedding_writer = self.embeddings_writer.clone();
+ tokio::spawn(async move {
+ if let Some(embedding_writer) = weak_embedding_writer.and_then(|w| w.upgrade()) {
+ embedding_writer
+ .queue_collab_embed(cloned_object, weak_collab)
+ .await;
+ }
+ });
let mut write_collab = collab.try_write()?;
let has_cloud_plugin = write_collab.borrow().has_cloud_plugin();
diff --git a/frontend/rust-lib/collab-integrate/src/instant_indexed_data_provider.rs b/frontend/rust-lib/collab-integrate/src/instant_indexed_data_provider.rs
index f2c1f66936..2cb2f9085b 100644
--- a/frontend/rust-lib/collab-integrate/src/instant_indexed_data_provider.rs
+++ b/frontend/rust-lib/collab-integrate/src/instant_indexed_data_provider.rs
@@ -8,7 +8,6 @@ use collab_entity::{CollabObject, CollabType};
use flowy_ai_pub::entities::{UnindexedCollab, UnindexedCollabMetadata, UnindexedData};
use flowy_error::{FlowyError, FlowyResult};
use lib_infra::async_trait::async_trait;
-use lib_infra::util::get_operating_system;
use std::borrow::BorrowMut;
use std::collections::HashMap;
use std::sync::{Arc, Weak};
@@ -68,10 +67,6 @@ impl InstantIndexedDataWriter {
}
pub async fn spawn_instant_indexed_provider(&self, runtime: &Runtime) -> FlowyResult<()> {
- if !get_operating_system().is_desktop() {
- return Ok(());
- }
-
let weak_collab_by_object = Arc::downgrade(&self.collab_by_object);
let consumers_weak = Arc::downgrade(&self.consumers);
let interval_dur = Duration::from_secs(30);
@@ -235,10 +230,6 @@ impl InstantIndexedDataWriter {
collab_object: CollabObject,
collab: Weak<dyn CollabIndexedData>,
) {
- if !get_operating_system().is_desktop() {
- return;
- }
-
if !self.support_collab_type(&collab_object.collab_type) {
return;
}