Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/hypergraph-react/src/HypergraphSpaceContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export function useQueryEntity<const S extends Entity.AnyNoContext>(
};

return useSyncExternalStore(subscribe, () => {
const doc = hypergraph.handle.docSync();
const doc = hypergraph.handle.doc();
if (doc === undefined) {
return prevEntityRef.current;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/hypergraph/src/entity/findMany.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ export function findMany<const S extends AnyNoContext>(
// @ts-expect-error name is defined
const typeName = type.name;

const doc = handle.docSync();
const doc = handle.doc();
if (!doc) {
return { entities: [], corruptEntityIds: [] };
}
Expand Down
2 changes: 1 addition & 1 deletion packages/hypergraph/src/entity/findOne.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const findOne = <const S extends AnyNoContext>(
return (id: string): Entity<S> | undefined => {
// TODO: Instead of this insane filtering logic, we should be keeping track of the entities in
// an index and store the decoded values instead of re-decoding over and over again.
const doc = handle.docSync();
const doc = handle.doc();
const entity = doc?.entities?.[id];
const relations = doc ? getEntityRelations(id, type, doc, include) : {};

Expand Down
Loading