diff --git a/src/hocs/copilot.js b/src/hocs/copilot.js index 85d09659..6cdec423 100644 --- a/src/hocs/copilot.js +++ b/src/hocs/copilot.js @@ -135,7 +135,11 @@ const copilot = ({ steps: Object.entries(steps) .filter(([key]) => key !== stepName) .reduce((obj, [key, val]) => Object.assign(obj, { [key]: val }), {}), - })); + }), () => { + if (Object.values(this.state.steps).length === 0 && this.state.visible) { + this.stop(); + } + }); } next = async (): void => {