Skip to content

Build your personal knowledge base with Trilium Notes

fix(react/type_widgets): relation map getting occassionally wiped

Elian Dorane8e93e985d53
diff --git a/apps/client/src/widgets/type_widgets/relation_map/RelationMap.tsx b/apps/client/src/widgets/type_widgets/relation_map/RelationMap.tsx
index 172c6a8cde..c342d257d3 100644
--- a/apps/client/src/widgets/type_widgets/relation_map/RelationMap.tsx
+++ b/apps/client/src/widgets/type_widgets/relation_map/RelationMap.tsx
@@ -192,6 +192,8 @@ async function useRelationData(noteId: string, mapData: MapData | undefined, map
const [ inverseRelations, setInverseRelations ] = useState<RelationMapPostResponse["inverseRelations"]>();
async function refresh() {
+ if (!noteIds) return;
+
const data = await server.post<RelationMapPostResponse>("relation-map", { noteIds, relationMapNoteId: noteId });
const relations: ClientRelation[] = [];