fix: add await to repo.find() call

repo.find() returns a Promise<DocHandle>, not DocHandle directly.
Added missing await keyword to fix TypeScript build error.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Jeff Emmett 2025-11-16 21:26:42 -07:00
parent c13c0d18e1
commit 39d96db3cf
1 changed files with 2 additions and 2 deletions

View File

@ -153,9 +153,9 @@ export function useAutomergeSync(config: AutomergeSyncConfig): TLStoreWithStatus
const docUrl = `automerge:${documentId}` as const const docUrl = `automerge:${documentId}` as const
try { try {
// Try to find the existing document - this is synchronous // Try to find the existing document
// It will throw if the document isn't in the repo yet // It will throw if the document isn't in the repo yet
handle = repo.find<TLStoreSnapshot>(docUrl as any) handle = await repo.find<TLStoreSnapshot>(docUrl as any)
console.log(`✅ Found existing document handle: ${handle.documentId}, isReady: ${handle.isReady()}`) console.log(`✅ Found existing document handle: ${handle.documentId}, isReady: ${handle.isReady()}`)
} catch (error) { } catch (error) {
// If find() throws (document unavailable), the document doesn't exist in this repo yet // If find() throws (document unavailable), the document doesn't exist in this repo yet