Skip to content

Commit

Permalink
Fix instantiation bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mirka committed Oct 3, 2021
1 parent f625aea commit cabea2e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/collaborative-editing/use-yjs/yjs-doc.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function createDocument( { identity, applyDataChanges, getData, getSelect
let undoManager;

const setupUndoManagerOnReady = ( state ) => {
if ( state === 'on' ) {
if ( state === 'on' && ! undoManager ) {
const postMap = doc.getMap( 'post' );
undoManager = new yjs.UndoManager( postMap, { trackedOrigins: new Set( [ identity ] ) } );

Expand Down

0 comments on commit cabea2e

Please sign in to comment.