fix: await repo.find() to fix TypeScript build errors
repo.find() returns a Promise<DocHandle>, so we need to await it. This fixes the TypeScript compilation errors in the build. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
432e90d9ef
commit
64d4a65613
|
|
@ -119,12 +119,13 @@ export function useAutomergeSync(config: AutomergeSyncConfig): TLStoreWithStatus
|
|||
// CRITICAL: Use repo.find() with a consistent document ID based on roomId
|
||||
// This ensures all windows/tabs share the same Automerge document and can sync properly
|
||||
// Format: automerge:${roomId} matches what the server expects (see AutomergeDurableObject.ts line 327)
|
||||
const documentId = `automerge:${roomId}`
|
||||
const documentId = `automerge:${roomId}` as any
|
||||
console.log(`🔌 Finding or creating Automerge document with ID: ${documentId}`)
|
||||
|
||||
// Use repo.find() to get or create the document with this ID
|
||||
// This ensures all windows share the same document instance
|
||||
const handle = repo.find(documentId)
|
||||
// Note: repo.find() returns a Promise, so we await it
|
||||
const handle = await repo.find(documentId)
|
||||
|
||||
console.log("Found/Created Automerge handle via Repo:", {
|
||||
handleId: handle.documentId,
|
||||
|
|
|
|||
Loading…
Reference in New Issue