From b95f29de5002c78868fd6f21564505d4c09aec6a Mon Sep 17 00:00:00 2001
From: Melissa Zhang <mzhang19096@gmail.com>
Date: Wed, 29 Apr 2020 11:47:53 -0700
Subject: fixed undo functionality

---
 src/client/views/nodes/ComparisonBox.tsx | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'src/client/views/nodes/ComparisonBox.tsx')

diff --git a/src/client/views/nodes/ComparisonBox.tsx b/src/client/views/nodes/ComparisonBox.tsx
index 6968d5a88..7b35b2811 100644
--- a/src/client/views/nodes/ComparisonBox.tsx
+++ b/src/client/views/nodes/ComparisonBox.tsx
@@ -15,6 +15,7 @@ import { FieldView, FieldViewProps } from './FieldView';
 import "./ComparisonBox.scss";
 import React = require("react");
 import { ContentFittingDocumentView } from './ContentFittingDocumentView';
+import { undoBatch } from '../../util/UndoManager';
 
 library.add(faImage, faEye as any, faPaintBrush, faBrain);
 library.add(faFileAudio, faAsterisk);
@@ -40,6 +41,7 @@ export class ComparisonBox extends ViewBoxAnnotatableComponent<FieldViewProps, C
         }
     }
 
+    @undoBatch
     private dropHandler = (event: Event, dropEvent: DragManager.DropEvent, fieldKey: string) => {
         event.stopPropagation();
         const droppedDocs = dropEvent.complete.docDragData?.droppedDocuments;
@@ -85,12 +87,14 @@ export class ComparisonBox extends ViewBoxAnnotatableComponent<FieldViewProps, C
         window.removeEventListener("pointerup", this.onPointerUp);
     }
 
+    @undoBatch
     clearBeforeDoc = (e: React.MouseEvent) => {
         e.stopPropagation;
         e.preventDefault;
         delete this.props.Document.beforeDoc;
     }
 
+    @undoBatch
     clearAfterDoc = (e: React.MouseEvent) => {
         e.stopPropagation;
         e.preventDefault;
-- 
cgit v1.2.3-70-g09d2

