diff options
author | bobzel <zzzman@gmail.com> | 2022-08-30 13:55:41 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2022-08-30 13:55:41 -0400 |
commit | 7f2556568ab635274c483d102fa4555d12e14835 (patch) | |
tree | a200eae31968fa2d2db119ddfded79042dfdcff0 /src/client/views/nodes/LoadingBox.tsx | |
parent | 5dcf35a986bb1d9dbe6c26d0a7056ac43ceed007 (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.tsx | 29 |
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> ); } |