Skip to content

Commit

Permalink
adds setAutoversioningInterval helper
Browse files Browse the repository at this point in the history
  • Loading branch information
janthurau committed Sep 8, 2024
1 parent ab62f16 commit fe7a925
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/provider/src/TiptapCollabProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,4 +318,13 @@ export class TiptapCollabProvider extends HocuspocusProvider {
this.getYThreads().unobserveDeep(callback)
}

private getCollabConfig<T>() {
return this.configuration.document.getMap<T>('__tiptapcollab__config')
}

setAutoversioningInterval(seconds: number) {
if (this.getCollabConfig<number>().get('intervalSeconds') !== seconds) {
this.getCollabConfig<number>().set('intervalSeconds', seconds)
}
}
}

0 comments on commit fe7a925

Please sign in to comment.