From 2e37f3fd5a3079aaddf1c8f1129170f20a579258 Mon Sep 17 00:00:00 2001
From: chris <kokosias@yahoo.gr>
Date: Wed, 6 May 2020 15:58:59 +0300
Subject: [PATCH] remove temp solution

---
 .../components/comments/CommentComponent.js   | 21 -------------------
 .../src/marks/commentMark.js                  |  2 +-
 2 files changed, 1 insertion(+), 22 deletions(-)

diff --git a/wax-prosemirror-components/src/components/comments/CommentComponent.js b/wax-prosemirror-components/src/components/comments/CommentComponent.js
index 34b0b5e1f..6aaba1dcb 100644
--- a/wax-prosemirror-components/src/components/comments/CommentComponent.js
+++ b/wax-prosemirror-components/src/components/comments/CommentComponent.js
@@ -143,33 +143,12 @@ const updateComments = view => {
     );
     const allComments = nodes.map(node => {
       return node.node.marks.filter(comment => {
-        if (comment.type.name === "comment") {
-          comment.pos = node.pos;
-          comment.length = node.node.nodeSize;
-        }
         return comment.type.name === "comment";
       });
     });
 
     const groupedComments = {};
     allComments.forEach(comment => {
-      //TEMP SOLUTION //TODO PROPERLY FIX IN PM PASTE
-      if (comment[0].attrs.id === "") {
-        const commentMark = view.state.schema.marks.comment;
-        const { tr } = view.state;
-        view.dispatch(
-          tr.setMeta("addToHistory", false).addMark(
-            comment[0].pos,
-            comment[0].pos + comment[0].length,
-            commentMark.create({
-              ...((comment[0] && comment[0].attrs) || {}),
-              id: uuidv4()
-            })
-          )
-        );
-      }
-      // until here
-
       if (!groupedComments[comment[0].attrs.group]) {
         groupedComments[comment[0].attrs.group] = [comment[0]];
       } else {
diff --git a/wax-prosemirror-schema/src/marks/commentMark.js b/wax-prosemirror-schema/src/marks/commentMark.js
index 2fc3ba73b..e297644dd 100644
--- a/wax-prosemirror-schema/src/marks/commentMark.js
+++ b/wax-prosemirror-schema/src/marks/commentMark.js
@@ -11,7 +11,7 @@ const comment = {
       tag: "span.comment[data-conversation]",
       getAttrs(dom) {
         return {
-          id: dom.id,
+          id: dom.dataset.id,
           group: dom.dataset.group,
           conversation: JSON.parse(dom.dataset.conversation)
         };
-- 
GitLab