diff --git a/src/components/RelationshipList.tsx b/src/components/RelationshipList.tsx
index 50da46d..b2de2f3 100644
--- a/src/components/RelationshipList.tsx
+++ b/src/components/RelationshipList.tsx
@@ -35,10 +35,6 @@ export function RelationshipList({
return ;
}
- const doc = docResult.value.doc;
-
- console.info("Rendering relationship list: ", relationshipType);
-
const relationshipResult = docResult.value.relationships[relationshipType];
const relationship =
@@ -60,7 +56,6 @@ export function RelationshipList({
try {
// Check for existing relationship
if (relationship) {
- console.debug("Adding to existing relationship", relationship.id);
const updatedRelationship: Relationship = await pb
.collection("relationships")
.update(relationship.id, {
@@ -68,11 +63,10 @@ export function RelationshipList({
});
dispatch({
type: "setRelationship",
- docId: doc.id,
+ docId: root.id,
relationship: updatedRelationship,
});
} else {
- console.debug("Creating new relationship");
const updatedRelationship: Relationship = await pb
.collection("relationships")
.create({
@@ -82,7 +76,7 @@ export function RelationshipList({
});
dispatch({
type: "setRelationship",
- docId: doc.id,
+ docId: root.id,
relationship: updatedRelationship,
});
}
@@ -99,7 +93,6 @@ export function RelationshipList({
try {
if (relationship) {
- console.debug("Removing from existing relationship", relationship.id);
const updatedRelationship: Relationship = await pb
.collection("relationships")
.update(relationship.id, {
@@ -107,7 +100,7 @@ export function RelationshipList({
});
dispatch({
type: "setRelationship",
- docId: doc.id,
+ docId: root.id,
relationship: updatedRelationship,
});
}
diff --git a/src/components/documents/DocumentView.tsx b/src/components/documents/DocumentView.tsx
index e29b029..4c60ee8 100644
--- a/src/components/documents/DocumentView.tsx
+++ b/src/components/documents/DocumentView.tsx
@@ -11,8 +11,6 @@ import { Route as RelationshipRoute } from "@/routes/_app/_authenticated/documen
export function DocumentView({ documentId }: { documentId: DocumentId }) {
const { docResult } = useDocument(documentId);
- console.info(`Rendering document: `, docResult);
-
if (docResult?.type !== "ready") {
return ;
}
@@ -50,16 +48,14 @@ export function DocumentView({ documentId }: { documentId: DocumentId }) {
{relationshipList.map((relationshipType) => (
-
+
{displayName(relationshipType)} (
{relationshipCounts[relationshipType] ?? 0})
diff --git a/src/components/documents/RelatedDocumentList.tsx b/src/components/documents/RelatedDocumentList.tsx
index a6b23db..514f2ae 100644
--- a/src/components/documents/RelatedDocumentList.tsx
+++ b/src/components/documents/RelatedDocumentList.tsx
@@ -13,8 +13,6 @@ export function RelatedDocumentList({ documentId, relationshipType }: Props) {
const { cache } = useDocumentCache();
- console.log(documentId, docResult, cache);
-
if (docResult?.type !== "ready") {
return
;
}
diff --git a/src/context/document/DocumentContext.tsx b/src/context/document/DocumentContext.tsx
index 5cc94bc..8d459a8 100644
--- a/src/context/document/DocumentContext.tsx
+++ b/src/context/document/DocumentContext.tsx
@@ -19,6 +19,8 @@ export const DocumentContext = createContext
(
export function DocumentProvider({ children }: { children: ReactNode }) {
const [state, dispatch] = useReducer(reducer, initialState());
+ console.log("State: ", state);
+
return (