diff options
author | srichman333 <sarah_n_richman@brown.edu> | 2023-10-10 16:21:41 -0400 |
---|---|---|
committer | srichman333 <sarah_n_richman@brown.edu> | 2023-10-10 16:21:41 -0400 |
commit | 9e91e6065333f03d3f3bf2c0d43b822d85344c78 (patch) | |
tree | 4c923fc8257b597d69700bee4c1a4e69d3cbe21a /src/client/views/nodes/LoadingBox.tsx | |
parent | 368e33c076085b1b73f522ac88f548a2ad081c80 (diff) | |
parent | d929c0511cae863412a398f426d9e5b7ca64e6d9 (diff) |
merge?
Diffstat (limited to 'src/client/views/nodes/LoadingBox.tsx')
-rw-r--r-- | src/client/views/nodes/LoadingBox.tsx | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/client/views/nodes/LoadingBox.tsx b/src/client/views/nodes/LoadingBox.tsx index 0b02626e9..bdc074e0c 100644 --- a/src/client/views/nodes/LoadingBox.tsx +++ b/src/client/views/nodes/LoadingBox.tsx @@ -46,7 +46,7 @@ export class LoadingBox extends ViewBoxAnnotatableComponent<FieldViewProps>() { const updateFunc = async () => { const result = await Networking.QueryYoutubeProgress(StrCast(this.rootDoc[Id])); // We use the guid of the overwriteDoc to track file uploads. runInAction(() => (this.progress = result.progress)); - this._timer = setTimeout(updateFunc, 1000); + !this.rootDoc.loadingError && (this._timer = setTimeout(updateFunc, 1000)); }; this._timer = setTimeout(updateFunc, 1000); } @@ -58,10 +58,14 @@ export class LoadingBox extends ViewBoxAnnotatableComponent<FieldViewProps>() { render() { return ( <div className="loadingBoxContainer" style={{ background: !this.rootDoc.loadingError ? '' : 'red' }}> - <div className="textContainer"> - <p className="headerText">{StrCast(this.rootDoc.loadingError, 'Loading ' + (this.progress.replace('[download]', '') || '(can take several minutes)'))}</p> - <span className="text">{StrCast(this.rootDoc.title)}</span> - {this.rootDoc.loadingError ? null : <ReactLoading type={'spinningBubbles'} color={'blue'} height={100} width={100} />} + <div className="loadingBox-textContainer"> + <span className="loadingBox-title">{StrCast(this.rootDoc.title)}</span> + <p className="loadingBox-headerText">{StrCast(this.rootDoc.loadingError, 'Loading ' + (this.progress.replace('[download]', '') || '(can take several minutes)'))}</p> + {this.rootDoc.loadingError ? null : ( + <div className="loadingBox-spinner"> + <ReactLoading type="spinningBubbles" color="blue" height={100} width={100} /> + </div> + )} </div> </div> ); |