From d310058e80f0896e2724f8723d5b95e1077296c1 Mon Sep 17 00:00:00 2001
From: bob <bcz@cs.brown.edu>
Date: Fri, 7 Feb 2020 15:06:46 -0500
Subject: fixed __LAYOUT__ and added action() to pivot-in action

---
 src/client/views/collections/CollectionTimeView.tsx | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

(limited to 'src/client/views/collections/CollectionTimeView.tsx')

diff --git a/src/client/views/collections/CollectionTimeView.tsx b/src/client/views/collections/CollectionTimeView.tsx
index 0c1f93829..4983acbc2 100644
--- a/src/client/views/collections/CollectionTimeView.tsx
+++ b/src/client/views/collections/CollectionTimeView.tsx
@@ -1,6 +1,6 @@
 import { faEdit } from "@fortawesome/free-solid-svg-icons";
 import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
-import { action, computed, observable, trace } from "mobx";
+import { action, computed, observable, trace, runInAction } from "mobx";
 import { observer } from "mobx-react";
 import { Set } from "typescript-collections";
 import { Doc, DocListCast, Field } from "../../../new_fields/Doc";
@@ -323,7 +323,9 @@ Scripting.addGlobal(function pivotColumnClick(pivotDoc: Doc, bounds: ViewDefBoun
     let pfilterIndex = NumCast(pivotDoc._pfilterIndex);
     pivotDoc["_pfilter" + pfilterIndex] = ObjectField.MakeCopy(pivotDoc._docFilter as ObjectField);
     pivotDoc._pfilterIndex = ++pfilterIndex;
-    pivotDoc._docFilter = new List();
-    (bounds.payload as string[]).map(filterVal =>
-        Doc.setDocFilter(pivotDoc, StrCast(pivotDoc._pivotField), filterVal, "check"));
+    runInAction(() => {
+        pivotDoc._docFilter = new List();
+        (bounds.payload as string[]).map(filterVal =>
+            Doc.setDocFilter(pivotDoc, StrCast(pivotDoc._pivotField), filterVal, "check"));
+    });
 });
\ No newline at end of file
-- 
cgit v1.2.3-70-g09d2

