Skip to content

Commit

Permalink
Make collabEditor in the collab guide base its state on the authority
Browse files Browse the repository at this point in the history
  • Loading branch information
marijnh committed Dec 19, 2018
1 parent 22edbf0 commit 1d16cb7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion markdown/guide/collab.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ import collab from "prosemirror-collab"

function collabEditor(authority, place) {
let view = new EditorView(place, {
state: EditorState.create({schema, plugins: [collab.collab()]}),
state: EditorState.create({
doc: authority.doc,
plugins: [collab.collab({version: authority.steps.length})]
}),
dispatchTransaction(transaction) {
let newState = view.state.apply(transaction)
view.updateState(newState)
Expand Down

0 comments on commit 1d16cb7

Please sign in to comment.