@imposium-hub/components 1.43.0 → 1.43.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -21,6 +21,7 @@ import {ICON_VIDEO, ICON_IMAGE, ICON_STICKY_NOTE} from '../../constants/icons';
|
|
|
21
21
|
import { formattedTime } from '../../Util';
|
|
22
22
|
import Timer from '../../services/Timer';
|
|
23
23
|
import LogViewer from '../log-viewer/LogViewer';
|
|
24
|
+
import { connect } from 'react-redux';
|
|
24
25
|
|
|
25
26
|
interface IStoryPreviewerProps {
|
|
26
27
|
api : IImposiumAPI;
|
|
@@ -35,6 +36,7 @@ interface IStoryPreviewerProps {
|
|
|
35
36
|
onJobCreated?(expId : string, jobId : string) : void;
|
|
36
37
|
onExperenceLoaded?(exp : IExperience) : void;
|
|
37
38
|
onError?(n : string) : void;
|
|
39
|
+
notifications : any;
|
|
38
40
|
}
|
|
39
41
|
|
|
40
42
|
interface IStoryPreviewerState {
|
|
@@ -210,6 +212,18 @@ class StoryPreviewer extends React.PureComponent<IStoryPreviewerProps, IStoryPre
|
|
|
210
212
|
});
|
|
211
213
|
}
|
|
212
214
|
|
|
215
|
+
if (this.props.notifications) {
|
|
216
|
+
if (this.props.notifications[0]) {
|
|
217
|
+
if (this.props.notifications[0]['type'] === 'error') {
|
|
218
|
+
this.setState({isTimeOut: true});
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
if (this.props.notifications[0]['type'] === 'info') {
|
|
222
|
+
this.setState({isTimeOut: false});
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
213
227
|
if (prevState.timeElapsed !== this.state.timeElapsed) {
|
|
214
228
|
if (formattedTime(this.state.timeElapsed) === this.TIMEOUT && !this.state.experience) {
|
|
215
229
|
|
|
@@ -530,7 +544,7 @@ class StoryPreviewer extends React.PureComponent<IStoryPreviewerProps, IStoryPre
|
|
|
530
544
|
jobId: null,
|
|
531
545
|
timeElapsed: !isTimeOut ? 0 : this.state.timeElapsed,
|
|
532
546
|
activeOutput: null,
|
|
533
|
-
isTimeOut
|
|
547
|
+
isTimeOut: false,
|
|
534
548
|
}, () => {
|
|
535
549
|
if (callback) {
|
|
536
550
|
callback();
|
|
@@ -656,5 +670,8 @@ class StoryPreviewer extends React.PureComponent<IStoryPreviewerProps, IStoryPre
|
|
|
656
670
|
</div>;
|
|
657
671
|
}
|
|
658
672
|
}
|
|
673
|
+
const mapStateToProps = (state) : any => {
|
|
674
|
+
return {notifications : state.notifications};
|
|
675
|
+
};
|
|
659
676
|
|
|
660
|
-
export default StoryPreviewer;
|
|
677
|
+
export default connect(mapStateToProps, {})(StoryPreviewer);
|