mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-06-07 09:55:43 -04:00
fix: retrieve read-only state for y-doc-sync-server-adapter from connection
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
29afcce555
commit
eebbb79d08
3 changed files with 5 additions and 5 deletions
|
@ -11,14 +11,14 @@ export class YDocSyncServerAdapter extends YDocSyncAdapter {
|
|||
constructor(
|
||||
readonly messageTransporter: MessageTransporter,
|
||||
readonly doc: RealtimeDoc,
|
||||
readonly acceptEdits: boolean
|
||||
private readonly acceptEditsProvider: () => boolean
|
||||
) {
|
||||
super(messageTransporter, doc)
|
||||
this.markAsSynced()
|
||||
}
|
||||
|
||||
protected applyIncomingUpdatePayload(update: number[]): void {
|
||||
if (!this.acceptEdits) {
|
||||
if (!this.acceptEditsProvider()) {
|
||||
return
|
||||
}
|
||||
super.applyIncomingUpdatePayload(update)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue