aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/LoadingBox.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2023-12-05 14:13:02 -0500
committerbobzel <zzzman@gmail.com>2023-12-05 14:13:02 -0500
commit3f412f469925f444714fd20a9bd76f4c36029d34 (patch)
tree4c0259357586cf88e56d5d3c20177aa6ed4b71db /src/client/views/nodes/LoadingBox.tsx
parent304f7e25fb2a533876a59bca7215126d02d94dbf (diff)
parent23f789ab0bc9947f1bd23816183df2b5cc89b0e6 (diff)
merged with master
Diffstat (limited to 'src/client/views/nodes/LoadingBox.tsx')
-rw-r--r--src/client/views/nodes/LoadingBox.tsx17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/client/views/nodes/LoadingBox.tsx b/src/client/views/nodes/LoadingBox.tsx
index 4bb0f14d2..e554cb8ad 100644
--- a/src/client/views/nodes/LoadingBox.tsx
+++ b/src/client/views/nodes/LoadingBox.tsx
@@ -57,28 +57,29 @@ export class LoadingBox extends ViewBoxAnnotatableComponent<FieldViewProps>() {
_timer: any;
@observable progress = '';
componentDidMount() {
- if (!LoadingBox.CurrentlyLoading?.includes(this.rootDoc)) {
- this.rootDoc.loadingError = 'Upload interrupted, please try again';
+ if (!LoadingBox.CurrentlyLoading?.includes(this.Document)) {
+ this.Document.loadingError = 'Upload interrupted, please try again';
} else {
const updateFunc = async () => {
- const result = await Networking.QueryYoutubeProgress(StrCast(this.rootDoc[Id])); // We use the guid of the overwriteDoc to track file uploads.
+ const result = await Networking.QueryYoutubeProgress(StrCast(this.Document[Id])); // We use the guid of the overwriteDoc to track file uploads.
runInAction(() => (this.progress = result.progress));
- !this.rootDoc.loadingError && (this._timer = setTimeout(updateFunc, 1000));
+ !this.Document.loadingError && this._timer && (this._timer = setTimeout(updateFunc, 1000));
};
this._timer = setTimeout(updateFunc, 1000);
}
}
componentWillUnmount() {
clearTimeout(this._timer);
+ this._timer = undefined;
}
render() {
return (
- <div className="loadingBoxContainer" style={{ background: !this.rootDoc.loadingError ? '' : 'red' }}>
+ <div className="loadingBoxContainer" style={{ background: !this.Document.loadingError ? '' : 'red' }}>
<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 : (
+ <span className="loadingBox-title">{StrCast(this.Document.title)}</span>
+ <p className="loadingBox-headerText">{StrCast(this.Document.loadingError, 'Loading ' + (this.progress.replace('[download]', '') || '(can take several minutes)'))}</p>
+ {this.Document.loadingError ? null : (
<div className="loadingBox-spinner">
<ReactLoading type="spinningBubbles" color="blue" height={100} width={100} />
</div>