From 366ac7e434be306ffd979d7f22ef50ad77fbc1eb Mon Sep 17 00:00:00 2001
From: ab <abdullah_ahmed@brown.edu>
Date: Tue, 11 Jun 2019 14:13:22 -0400
Subject: lolz

---
 src/client/util/TooltipTextMenu.tsx | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

(limited to 'src/client/util/TooltipTextMenu.tsx')

diff --git a/src/client/util/TooltipTextMenu.tsx b/src/client/util/TooltipTextMenu.tsx
index c5d016547..905f1969c 100644
--- a/src/client/util/TooltipTextMenu.tsx
+++ b/src/client/util/TooltipTextMenu.tsx
@@ -278,14 +278,18 @@ export class TooltipTextMenu {
         let select = state.selection;
         let node = select.$from.nodeAfter;
         if (node) {
-            console.log("node");
-            console.log(node.type.name);
             if (node.type.name === "star") {
-                console.log(node.attrs.oldtext);
+                let oldselection = node.attrs.oldtext;
+                if (dispatch) {
+                    dispatch(state.tr.replaceSelection(oldselection.content()));
+                }
+                return true;
             }
         }
         if (dispatch) {
-            dispatch(state.tr.replaceSelectionWith(type.create({ attrs: { oldtext: select } })));
+            let newNode = type.create();
+            newNode.attrs.oldtext = select;
+            dispatch(state.tr.replaceSelectionWith(newNode));
         }
         return true;
     }
-- 
cgit v1.2.3-70-g09d2

