Skip to content

Commit

Permalink
fix(collaboration): fix typing issues
Browse files Browse the repository at this point in the history
  • Loading branch information
bdbch committed Jan 11, 2024
1 parent 23b32f8 commit abee6d5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/extension-collaboration/src/collaboration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export const Collaboration = Extension.create<CollaborationOptions>({
undoManager.restore = () => {}
}

const viewRet = originalUndoPluginView(view)
const viewRet = originalUndoPluginView ? originalUndoPluginView(view) : null

return {
destroy: () => {
Expand All @@ -142,7 +142,9 @@ export const Collaboration = Extension.create<CollaborationOptions>({
undoManager._observers = observers
}

viewRet.destroy()
if (viewRet && viewRet.destroy) {
viewRet.destroy()
}
},
}
}
Expand Down

0 comments on commit abee6d5

Please sign in to comment.