Skip to content

Commit

Permalink
support id for import
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianHung authored Sep 24, 2024
1 parent 824d08a commit 3476246
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/automerge-repo/src/Repo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -493,10 +493,10 @@ export class Repo extends EventEmitter<RepoEvents> {
* Imports document binary into the repo.
* @param binary - The binary to import
*/
import<T>(binary: Uint8Array) {
import<T>(binary: Uint8Array, id: AnyDocumentId = generateAutomergeUrl()) {
const doc = Automerge.load<T>(binary)

const handle = this.create<T>()
const handle = this.create<T>(undefined, id)

handle.update(() => {
return Automerge.clone(doc)
Expand Down

0 comments on commit 3476246

Please sign in to comment.