aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/search
diff options
context:
space:
mode:
authorTyler Schicke <tyler_schicke@brown.edu>2019-07-08 13:40:09 -0400
committerTyler Schicke <tyler_schicke@brown.edu>2019-07-08 13:40:09 -0400
commit5642ee106ac37982a84192cc2e7a694da3b4fc3f (patch)
treee1a7cad93e4a9ebe21abff1dc3b78cda7f95193f /src/client/views/search
parent400c525875af607dd76d7ec46949fedc418caabf (diff)
Hopefully got rid of new Docs being created too frequently
Diffstat (limited to 'src/client/views/search')
-rw-r--r--src/client/views/search/SearchItem.tsx16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/client/views/search/SearchItem.tsx b/src/client/views/search/SearchItem.tsx
index 6cedc7cfb..99701471d 100644
--- a/src/client/views/search/SearchItem.tsx
+++ b/src/client/views/search/SearchItem.tsx
@@ -187,10 +187,10 @@ export class SearchItem extends React.Component<SearchItemProps> {
if (this.props.doc.type === DocTypes.LINK) {
if (this.props.doc.anchor1 && this.props.doc.anchor2) {
- let doc1 = Cast(this.props.doc.anchor1, Doc, new Doc());
- let doc2 = Cast(this.props.doc.anchor2, Doc, new Doc());
- doc1.libraryBrush = true;
- doc2.libraryBrush = true;
+ let doc1 = Cast(this.props.doc.anchor1, Doc, null);
+ let doc2 = Cast(this.props.doc.anchor2, Doc, null);
+ doc1 && (doc1.libraryBrush = true);
+ doc2 && (doc2.libraryBrush = true);
}
} else {
let docViews: DocumentView[] = DocumentManager.Instance.getAllDocumentViews(this.props.doc);
@@ -204,10 +204,10 @@ export class SearchItem extends React.Component<SearchItemProps> {
if (this.props.doc.type === DocTypes.LINK) {
if (this.props.doc.anchor1 && this.props.doc.anchor2) {
- let doc1 = Cast(this.props.doc.anchor1, Doc, new Doc());
- let doc2 = Cast(this.props.doc.anchor2, Doc, new Doc());
- doc1.libraryBrush = false;
- doc2.libraryBrush = false;
+ let doc1 = Cast(this.props.doc.anchor1, Doc, null);
+ let doc2 = Cast(this.props.doc.anchor2, Doc, null);
+ doc1 && (doc1.libraryBrush = false);
+ doc2 && (doc2.libraryBrush = false);
}
} else {
let docViews: DocumentView[] = DocumentManager.Instance.getAllDocumentViews(this.props.doc);