From 416131aa8fe6be64c59990dbca7adaa0a3de8bac Mon Sep 17 00:00:00 2001 From: lucaronin Date: Thu, 14 May 2026 16:09:54 +0200 Subject: [PATCH] fix: restore TypeScript build --- src/hooks/useNoteCreation.ts | 2 +- src/utils/pulledVaultRefresh.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/hooks/useNoteCreation.ts b/src/hooks/useNoteCreation.ts index a16bd6ba..b9b39b42 100644 --- a/src/hooks/useNoteCreation.ts +++ b/src/hooks/useNoteCreation.ts @@ -429,7 +429,7 @@ interface PersistNewNoteRequest { vaultPath?: string } -function createNoteContentArgs({ path, content, vaultPath }: PersistNewNoteRequest): PersistNewNoteRequest { +function createNoteContentArgs({ path, content, vaultPath }: PersistNewNoteRequest): Record { return vaultPath ? { path, content, vaultPath } : { path, content } } diff --git a/src/utils/pulledVaultRefresh.ts b/src/utils/pulledVaultRefresh.ts index 9f36997e..9be7826e 100644 --- a/src/utils/pulledVaultRefresh.ts +++ b/src/utils/pulledVaultRefresh.ts @@ -51,7 +51,8 @@ function findExternallyMovedActiveEntry(options: { && updatedPaths.has(normalizeNotePathForIdentity(entry.path)), ) - return candidates.length === 1 ? candidates[0] : null + const [candidate] = candidates + return candidates.length === 1 && candidate ? candidate : null } function isActivePathBlocked(options: { @@ -117,7 +118,7 @@ export async function refreshPulledVaultState(options: PulledVaultRefreshOptions if (isActivePathBlocked({ activeTabPath, latestActiveTabPath, hasUnsavedChanges })) return entries const activePath = latestActiveTabPath as string - const refreshedEntry = findByNotePath(entries, activePath) + const refreshedEntry = findByNotePath(entries, activePath) ?? null const movedEntry = refreshedEntry ? null : findExternallyMovedActiveEntry({ activeTabPath: activePath, entries,