Skip to content

Commit

Permalink
fix: collab origin for observer notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
richardshiue committed Nov 7, 2024
1 parent 0925271 commit 51027f4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion collab-database/src/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1715,6 +1715,11 @@ impl DatabaseBody {
notifier: Option<DatabaseNotify>,
) -> Option<Self> {
let txn = collab.context.transact();
let origin = if notifier.is_some() {
collab.origin().clone()
} else {
CollabOrigin::Empty
};
let root: MapRef = collab.data.get_with_txn(&txn, DATABASE)?;
let database_id = root.get_with_txn(&txn, DATABASE_ID)?;
let fields: MapRef = root.get_with_txn(&txn, FIELDS)?; // { DATABASE: { FIELDS: {:} } }
Expand All @@ -1723,7 +1728,7 @@ impl DatabaseBody {

let fields = FieldMap::new(fields, notifier.as_ref().map(|n| n.field_change_tx.clone()));
let views = DatabaseViews::new(
CollabOrigin::Empty,
origin,
views,
notifier.as_ref().map(|n| n.view_change_tx.clone()),
);
Expand Down

0 comments on commit 51027f4

Please sign in to comment.