fix: add warn message when using collab and history extension together

This commit is contained in:
Philipp Kühn
2021-05-09 23:49:20 +02:00
parent db92a9b313
commit bf50af4cf6

View File

@@ -47,6 +47,12 @@ export const Collaboration = Extension.create<CollaborationOptions>({
fragment: null,
},
onCreate() {
if (this.editor.extensionManager.extensions.find(extension => extension.name === 'history')) {
console.warn('[tiptap warn]: "@tiptap/extension-collaboration" comes with its own history support and is not compatible with "@tiptap/extension-history".')
}
},
addCommands() {
return {
undo: () => ({ tr, state, dispatch }) => {