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.

503 B
Raw Blame
use collab::preclude::Collab;

use collab_integrate::{CollabKVAction, PersistenceError};
use flowy_error::FlowyResult;

pub(crate) fn load_collab<'a, R>(
  uid: i64,
  collab_r_txn: &R,
  workspace_id: &str,
  object_id: &str,
) -> FlowyResult<Collab>
where
  R: CollabKVAction<'a>,
  PersistenceError: From<R::Error>,
{
  let mut collab = Collab::new(uid, object_id, "phantom", vec![], false);
  collab_r_txn.load_doc_with_txn(uid, workspace_id, object_id, &mut collab.transact_mut())?;
  Ok(collab)
}