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:
parent
c13c0d18e1
commit
39d96db3cf
|
|
@ -153,9 +153,9 @@ export function useAutomergeSync(config: AutomergeSyncConfig): TLStoreWithStatus
|
|||
const docUrl = `automerge:${documentId}` as const
|
||||
|
||||
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
|
||||
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()}`)
|
||||
} catch (error) {
|
||||
// If find() throws (document unavailable), the document doesn't exist in this repo yet
|
||||
|
|
|
|||
Loading…
Reference in New Issue