From 10fe1239bdafcef536f28b7e602a090760ec0229 Mon Sep 17 00:00:00 2001 From: lucaronin Date: Fri, 17 Apr 2026 00:47:28 +0200 Subject: [PATCH] fix: restore inspector build types --- src/components/Inspector.tsx | 5 +++-- src/components/inspector/useInspectorPropertyActions.ts | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/Inspector.tsx b/src/components/Inspector.tsx index 8f89a6d9..25901892 100644 --- a/src/components/Inspector.tsx +++ b/src/components/Inspector.tsx @@ -12,6 +12,7 @@ import { InstancesPanel, NoteInfoPanel, } from './InspectorPanels' +import type { ReferencedByItem } from './InspectorPanels' import { EmptyInspector, InitializePropertiesPrompt, InspectorHeader, InvalidFrontmatterNotice } from './inspector/InspectorChrome' import { useBacklinks, useReferencedBy } from './inspector/useInspectorData' import { useInspectorPropertyActions } from './inspector/useInspectorPropertyActions' @@ -64,7 +65,7 @@ function ValidFrontmatterPanels({ frontmatter: ReturnType typeEntryMap: Record vaultPath?: string - referencedBy: VaultEntry[] + referencedBy: ReferencedByItem[] onNavigate: (target: string) => void onCreateAndOpenNote?: (title: string) => Promise onUpdateProperty?: (key: string, value: FrontmatterValue) => void @@ -125,7 +126,7 @@ function PrimaryInspectorPanel({ entries: VaultEntry[] typeEntryMap: Record vaultPath?: string - referencedBy: VaultEntry[] + referencedBy: ReferencedByItem[] onNavigate: (target: string) => void onToggleRawEditor?: () => void onInitializeProperties?: (path: string) => void diff --git a/src/components/inspector/useInspectorPropertyActions.ts b/src/components/inspector/useInspectorPropertyActions.ts index db6e6156..db33434b 100644 --- a/src/components/inspector/useInspectorPropertyActions.ts +++ b/src/components/inspector/useInspectorPropertyActions.ts @@ -23,8 +23,9 @@ function bindMissingTypeAction( entry: VaultEntry | null, action: ((path: string, missingType: string, nextTypeName: string) => Promise) | undefined, ) { - if (!entry?.isA || !action) return undefined - return (nextTypeName: string) => action(entry.path, entry.isA, nextTypeName) + const missingType = entry?.isA + if (!entry || !missingType || !action) return undefined + return (nextTypeName: string) => action(entry.path, missingType, nextTypeName) } export function useInspectorPropertyActions({