diff --git a/src/automerge/useAutomergeSyncRepo.ts b/src/automerge/useAutomergeSyncRepo.ts index da44d2f..ac26137 100644 --- a/src/automerge/useAutomergeSyncRepo.ts +++ b/src/automerge/useAutomergeSyncRepo.ts @@ -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(docUrl as any) + handle = await repo.find(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