Fixes bug with updating relationships when an item is added

This commit is contained in:
2025-07-15 10:09:53 -07:00
parent 258518d954
commit 8f96062058
5 changed files with 7 additions and 28 deletions

View File

@@ -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 <Loader />;
}
@@ -50,16 +48,14 @@ export function DocumentView({ documentId }: { documentId: DocumentId }) {
<ul className="flex flex-row gap-1">
{relationshipList.map((relationshipType) => (
<Link
key={relationshipType}
to={RelationshipRoute.to}
params={{
documentId,
relationshipType,
}}
>
<div
key={relationshipType}
className="px-3 py-2 rounded bg-slate-800 text-slate-100 border border-slate-700 focus:outline-none focus:ring-2 focus:ring-violet-500 data-selected:bg-violet-900 data-selected:border-violet-700 whitespace-nowrap"
>
<div className="px-3 py-2 rounded bg-slate-800 text-slate-100 border border-slate-700 focus:outline-none focus:ring-2 focus:ring-violet-500 data-selected:bg-violet-900 data-selected:border-violet-700 whitespace-nowrap">
{displayName(relationshipType)} (
{relationshipCounts[relationshipType] ?? 0})
</div>