From d089259080d4ae538ce07646f972ba39e804bfba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Ku=CC=88hn?= Date: Fri, 28 Sep 2018 13:55:34 +0200 Subject: [PATCH] refactoring --- packages/tiptap-commands/src/commands/replaceText.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/tiptap-commands/src/commands/replaceText.js b/packages/tiptap-commands/src/commands/replaceText.js index af410be8..4ac8480c 100644 --- a/packages/tiptap-commands/src/commands/replaceText.js +++ b/packages/tiptap-commands/src/commands/replaceText.js @@ -8,11 +8,7 @@ export default function (pos, type, attrs = {}) { } if (dispatch) { - // const transform = state.tr - // .replaceWith(pos.from, pos.to, state.schema.nodes.mention.create({ id: 2, type: 'user', label: 'loool' })) - const transform = state.tr.replaceWith(pos.from, pos.to, type.create(attrs)) - - dispatch(transform) + dispatch(state.tr.replaceWith(pos.from, pos.to, type.create(attrs))) } return true