From 22372bb12fdc29167f9c93bbf11a8d192f9b6c92 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Wed, 2 Dec 2020 09:18:57 -0500
Subject: added a loadtime cookie to keep track of last load time.

---
 src/client/views/Main.tsx | 7 +++++++
 1 file changed, 7 insertions(+)

(limited to 'src/client/views/Main.tsx')

diff --git a/src/client/views/Main.tsx b/src/client/views/Main.tsx
index c256d2ebb..34bfa8e77 100644
--- a/src/client/views/Main.tsx
+++ b/src/client/views/Main.tsx
@@ -24,5 +24,12 @@ AssignAllExtensions();
             event.preventDefault();
         }
     }, true);
+    const startload = (document as any).startLoad;
+    const loading = Date.now() - (startload ? Number(startload) : (Date.now() - 3000));
+    console.log("Load Time = " + loading);
+    var d = new Date();
+    d.setTime(d.getTime() + (100 * 24 * 60 * 60 * 1000));
+    var expires = "expires=" + d.toUTCString();
+    document.cookie = `loadtime=${loading};${expires};path=/`;
     ReactDOM.render(<MainView />, document.getElementById('root'));
 })();
\ No newline at end of file
-- 
cgit v1.2.3-70-g09d2


From 8fdd7fe99ef3360e2693f9abcd9b4fc22096b88b Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Wed, 2 Dec 2020 09:39:46 -0500
Subject: fixed warnings.  prevent titles form showing up in presentationView

---
 src/client/views/Main.tsx               | 4 ++--
 src/client/views/nodes/DocumentView.tsx | 2 +-
 src/client/views/nodes/FilterBox.tsx    | 2 +-
 src/fields/Doc.ts                       | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

(limited to 'src/client/views/Main.tsx')

diff --git a/src/client/views/Main.tsx b/src/client/views/Main.tsx
index 34bfa8e77..92f6ae028 100644
--- a/src/client/views/Main.tsx
+++ b/src/client/views/Main.tsx
@@ -27,9 +27,9 @@ AssignAllExtensions();
     const startload = (document as any).startLoad;
     const loading = Date.now() - (startload ? Number(startload) : (Date.now() - 3000));
     console.log("Load Time = " + loading);
-    var d = new Date();
+    const d = new Date();
     d.setTime(d.getTime() + (100 * 24 * 60 * 60 * 1000));
-    var expires = "expires=" + d.toUTCString();
+    const expires = "expires=" + d.toUTCString();
     document.cookie = `loadtime=${loading};${expires};path=/`;
     ReactDOM.render(<MainView />, document.getElementById('root'));
 })();
\ No newline at end of file
diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx
index 62a2b5bc5..76729d66c 100644
--- a/src/client/views/nodes/DocumentView.tsx
+++ b/src/client/views/nodes/DocumentView.tsx
@@ -127,7 +127,7 @@ export class DocumentView extends DocComponent<DocumentViewProps, Document>(Docu
     public get LayoutFieldKey() { return this.props.layoutKey || Doc.LayoutFieldKey(this.layoutDoc); }
     @computed get ShowTitle() {
         return StrCast(this.layoutDoc._showTitle,
-            !Doc.IsSystem(this.layoutDoc) && this.rootDoc.type === DocumentType.RTF && !this.props.treeViewDoc ?
+            !Doc.IsSystem(this.layoutDoc) && this.rootDoc.type === DocumentType.RTF && !this.props.treeViewDoc && !this.rootDoc.presentationTargetDoc ?
                 (this.dataDoc.author === Doc.CurrentUserEmail ? StrCast(Doc.UserDoc().showTitle) : "author;creationDate") :
                 undefined);
     }
diff --git a/src/client/views/nodes/FilterBox.tsx b/src/client/views/nodes/FilterBox.tsx
index ab401213c..6f0828a7d 100644
--- a/src/client/views/nodes/FilterBox.tsx
+++ b/src/client/views/nodes/FilterBox.tsx
@@ -161,7 +161,7 @@ export class FilterBox extends ViewBoxBaseComponent<FieldViewProps, FilterBoxDoc
     }
 
     render() {
-        const facetCollection = this.props.Document as Doc;
+        const facetCollection = this.props.Document;
         const flyout = <div className="filterBox-flyout" style={{ width: `100%`, height: this.props.PanelHeight() - 30 }} onWheel={e => e.stopPropagation()}>
             {this._allFacets.map(facet => <label className="filterBox-flyout-facet" key={`${facet}`} onClick={e => this.facetClick(facet)}>
                 <input type="checkbox" onChange={e => { }} checked={DocListCast(this.props.Document[this.props.fieldKey]).some(d => d.title === facet)} />
diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts
index 7b01d60e5..782c6c8b3 100644
--- a/src/fields/Doc.ts
+++ b/src/fields/Doc.ts
@@ -76,7 +76,7 @@ export function DocListCastAsync(field: FieldResult, defaultValue?: Doc[]) {
 
 export async function DocCastAsync(field: FieldResult): Promise<Opt<Doc>> { return Cast(field, Doc); }
 
-export function StrListCast(field: FieldResult) { return Cast(field, listSpec("string"), []) as string[]; }
+export function StrListCast(field: FieldResult) { return Cast(field, listSpec("string"), []); }
 export function DocListCast(field: FieldResult) { return Cast(field, listSpec(Doc), []).filter(d => d instanceof Doc) as Doc[]; }
 export function DocListCastOrNull(field: FieldResult) { return Cast(field, listSpec(Doc), null)?.filter(d => d instanceof Doc) as Doc[] | undefined; }
 
-- 
cgit v1.2.3-70-g09d2

