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
ca9f250de8
commit
3231720004
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue