From 7f2556568ab635274c483d102fa4555d12e14835 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Tue, 30 Aug 2022 13:55:41 -0400
Subject: fixed loadingDocument issues with overwriting height with NaN and
 setting 'data' field unnecessarily and at the expense of being able to set it
 for replacement docs when using animation frames

---
 src/client/views/nodes/LoadingBox.tsx | 29 +++++------------------------
 1 file changed, 5 insertions(+), 24 deletions(-)

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

diff --git a/src/client/views/nodes/LoadingBox.tsx b/src/client/views/nodes/LoadingBox.tsx
index 90bf90095..f3243f6cd 100644
--- a/src/client/views/nodes/LoadingBox.tsx
+++ b/src/client/views/nodes/LoadingBox.tsx
@@ -35,33 +35,14 @@ export class LoadingBox extends ViewBoxAnnotatableComponent<FieldViewProps>() {
         return FieldView.LayoutString(LoadingBox, fieldKey);
     }
 
-    /**
-     * Returns true if file is uploading, false otherwise
-     */
-    @computed private get isLoading(): boolean {
-        const file = Docs.Create.docsToFiles.get(this.rootDoc);
-        return file ? true : false;
-    }
-
-    constructor(props: any) {
-        super(props);
-    }
-
     render() {
         return (
             <div className="loadingBoxContainer">
-                {this.isLoading ? (
-                    <div className="textContainer">
-                        <p className="headerText">Loading:</p>
-                        <span className="text">{StrCast(this.rootDoc.title)}</span>
-                        <ReactLoading type={'spinningBubbles'} color={'blue'} height={100} width={100} />
-                    </div>
-                ) : (
-                    <div className="textContainer">
-                        <p className="headerText">Error Loading File: </p>
-                        <span className="text">{StrCast(this.rootDoc.title)}</span>
-                    </div>
-                )}
+                <div className="textContainer">
+                    <p className="headerText">{this.rootDoc.isLoading ? 'Loading:' : 'Error Loading File:'}</p>
+                    <span className="text">{StrCast(this.rootDoc.title)}</span>
+                    {!this.rootDoc.isLoading ? null : <ReactLoading type={'spinningBubbles'} color={'blue'} height={100} width={100} />}
+                </div>
             </div>
         );
     }
-- 
cgit v1.2.3-70-g09d2

