fix: resolve pre-existing TypeScript build errors
- Accept string | null in typeColors functions (matches VaultEntry.isA type) - Add missing snippet/relationships fields to test mock entries - Remove unused imports (AIChatPanel in App, cn in Editor) - Fix Promise type cast in Editor.tsx tryParseMarkdownToBlocks - Fix null coalescing in Inspector resolveRefType return - Remove unused container variable in NoteList test Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -27,11 +27,11 @@ const DEFAULT_COLOR = 'var(--accent-blue)'
|
||||
const DEFAULT_LIGHT_COLOR = 'var(--accent-blue-light)'
|
||||
|
||||
/** Returns the CSS variable for the accent color of a given note type */
|
||||
export function getTypeColor(isA: string): string {
|
||||
return TYPE_COLOR_MAP[isA] ?? DEFAULT_COLOR
|
||||
export function getTypeColor(isA: string | null): string {
|
||||
return (isA && TYPE_COLOR_MAP[isA]) ?? DEFAULT_COLOR
|
||||
}
|
||||
|
||||
/** Returns the CSS variable for the light/background variant of a given note type's color */
|
||||
export function getTypeLightColor(isA: string): string {
|
||||
return TYPE_LIGHT_COLOR_MAP[isA] ?? DEFAULT_LIGHT_COLOR
|
||||
export function getTypeLightColor(isA: string | null): string {
|
||||
return (isA && TYPE_LIGHT_COLOR_MAP[isA]) ?? DEFAULT_LIGHT_COLOR
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user