Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (callbackProps.status === STATUS.SKIPPED || callbackProps.status === STATUS.FINISHED) {
try {
// FIXME?
// this.setState({ run: false, stepIndex: 0 });
switch (callbackProps.status) {
case STATUS.SKIPPED:
RendererAnalytics.event({category: 'tour-result', action: 'skipped'});
RendererAnalytics.event({category: 'tour-skip', action: 'skipped-at-step-' + callbackProps.index});
LifecycleToggle.mark(LifecycleEvents.TOUR_SKIPPED);
break;
case STATUS.FINISHED:
RendererAnalytics.event({category: 'tour-result', action: 'finished'});
LifecycleToggle.mark(LifecycleEvents.TOUR_FINISHED);
break;
}
} finally {
LifecycleToggle.mark(LifecycleEvents.TOUR_TERMINATED);
}
} else if (callbackProps.type === EVENTS.STEP_AFTER) {
if ( ! this.state.run) {
setTimeout(() => {
joyrideCallback = (data) => {
const { status } = data;
if (status === STATUS.FINISHED) {
ls.set(LS_TOUR_KEY, true);
this.setState({
tourCompleted: true,
});
}
}
RendererAnalytics.event({category: 'viewer-tour-steps', action: 'did-step-' + callbackProps.index});
if (callbackProps.status === STATUS.SKIPPED || callbackProps.status === STATUS.FINISHED) {
try {
switch (callbackProps.status) {
case STATUS.SKIPPED:
RendererAnalytics.event({category: 'viewer-tour-result', action: 'skipped'});
RendererAnalytics.event({category: 'viewer-tour-skip', action: 'skipped-at-step-' + callbackProps.index});
LifecycleToggle.mark(LifecycleEvents.VIEWER_TOUR_SKIPPED);
break;
case STATUS.FINISHED:
RendererAnalytics.event({category: 'viewer-tour-result', action: 'finished'});
LifecycleToggle.mark(LifecycleEvents.VIEWER_TOUR_FINISHED);
break;
}
} finally {
LifecycleToggle.mark(LifecycleEvents.VIEWER_TOUR_TERMINATED);
}
}
}