aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/LoadingBox.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2022-09-20 12:58:18 -0400
committerbobzel <zzzman@gmail.com>2022-09-20 12:58:18 -0400
commitb6cd6616784769602b33605a720fe55295c2fbed (patch)
tree39b85d5d0741ec34ff08b2901ffc91898b5f9cea /src/client/views/nodes/LoadingBox.tsx
parent6a6fb81eb84c26001f76ae7fc7f0ed58d8259697 (diff)
parent945c0cd12fb2a792d10800f81b52cbac8aa12a41 (diff)
Merge remote-tracking branch 'origin/mehek-loading-fixes'
Diffstat (limited to 'src/client/views/nodes/LoadingBox.tsx')
-rw-r--r--src/client/views/nodes/LoadingBox.tsx9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/client/views/nodes/LoadingBox.tsx b/src/client/views/nodes/LoadingBox.tsx
index acf728ebb..220cd0880 100644
--- a/src/client/views/nodes/LoadingBox.tsx
+++ b/src/client/views/nodes/LoadingBox.tsx
@@ -1,6 +1,8 @@
+import { observable } from 'mobx';
import { observer } from 'mobx-react';
import * as React from 'react';
import ReactLoading from 'react-loading';
+import { Doc } from '../../../fields/Doc';
import { StrCast } from '../../../fields/Types';
import { ViewBoxAnnotatableComponent } from '../DocComponent';
import { FieldView, FieldViewProps } from './FieldView';
@@ -33,6 +35,13 @@ export class LoadingBox extends ViewBoxAnnotatableComponent<FieldViewProps>() {
return FieldView.LayoutString(LoadingBox, fieldKey);
}
+ componentDidMount() {
+ if (!Doc.CurrentlyLoading || !Doc.CurrentlyLoading.includes(this.rootDoc)) {
+ this.rootDoc.isLoading = false;
+ this.rootDoc.errorMessage = 'Upload was interrupted, please try again';
+ }
+ }
+
render() {
return (
<div className="loadingBoxContainer" style={{ background: this.rootDoc.isLoading ? '' : 'red' }}>