diff options
author | bobzel <zzzman@gmail.com> | 2022-09-22 16:00:17 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2022-09-22 16:00:17 -0400 |
commit | 48e0885b405cbfe728b1eda78efc19e15a104426 (patch) | |
tree | e02d511ad1a413cb7460d32d75675aa85bee4a8e /src/client/views/nodes/LoadingBox.tsx | |
parent | a2275a7477bbf02c4ef6c1f388bb08083528f5f1 (diff) |
fixed error messages on loading to not generate temporary error message when there is no error.
Diffstat (limited to 'src/client/views/nodes/LoadingBox.tsx')
-rw-r--r-- | src/client/views/nodes/LoadingBox.tsx | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/client/views/nodes/LoadingBox.tsx b/src/client/views/nodes/LoadingBox.tsx index 220cd0880..53390328f 100644 --- a/src/client/views/nodes/LoadingBox.tsx +++ b/src/client/views/nodes/LoadingBox.tsx @@ -1,4 +1,3 @@ -import { observable } from 'mobx'; import { observer } from 'mobx-react'; import * as React from 'react'; import ReactLoading from 'react-loading'; @@ -36,19 +35,18 @@ export class LoadingBox extends ViewBoxAnnotatableComponent<FieldViewProps>() { } componentDidMount() { - if (!Doc.CurrentlyLoading || !Doc.CurrentlyLoading.includes(this.rootDoc)) { - this.rootDoc.isLoading = false; - this.rootDoc.errorMessage = 'Upload was interrupted, please try again'; + if (!Doc.CurrentlyLoading?.includes(this.rootDoc)) { + this.rootDoc.loadingError = 'Upload interrupted, please try again'; } } render() { return ( - <div className="loadingBoxContainer" style={{ background: this.rootDoc.isLoading ? '' : 'red' }}> + <div className="loadingBoxContainer" style={{ background: !this.rootDoc.loadingError ? '' : 'red' }}> <div className="textContainer"> - <p className="headerText">{this.rootDoc.isLoading ? 'Loading (can take several minutes):' : StrCast(this.rootDoc.errorMessage, 'Error Loading File:')}</p> + <p className="headerText">{StrCast(this.rootDoc.loadingError, 'Loading (can take several minutes):')}</p> <span className="text">{StrCast(this.rootDoc.title)}</span> - {!this.rootDoc.isLoading ? null : <ReactLoading type={'spinningBubbles'} color={'blue'} height={100} width={100} />} + {this.rootDoc.loadingError ? null : <ReactLoading type={'spinningBubbles'} color={'blue'} height={100} width={100} />} </div> </div> ); |