aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/LoadingBox.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2022-08-30 13:55:41 -0400
committerbobzel <zzzman@gmail.com>2022-08-30 13:55:41 -0400
commit7f2556568ab635274c483d102fa4555d12e14835 (patch)
treea200eae31968fa2d2db119ddfded79042dfdcff0 /src/client/views/nodes/LoadingBox.tsx
parent5dcf35a986bb1d9dbe6c26d0a7056ac43ceed007 (diff)
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
Diffstat (limited to 'src/client/views/nodes/LoadingBox.tsx')
-rw-r--r--src/client/views/nodes/LoadingBox.tsx29
1 files changed, 5 insertions, 24 deletions
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>
);
}