Skip to content

Commit

Permalink
Merge pull request #194 from gilbarbara/issue188-restart-with-autorun
Browse files Browse the repository at this point in the history
Respect `autoStart` prop when resetting
  • Loading branch information
gilbarbara authored Jan 14, 2017
2 parents 7adbf8a + 2df739d commit 0dd249e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/scripts/Joyride.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions src/scripts/Joyride.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,11 @@ class Joyride extends React.Component {
const { index, isRunning } = this.state;
const shouldRestart = restart === true;

const newState = JSON.parse(JSON.stringify(defaultState));
newState.isRunning = shouldRestart;
const newState = {
...defaultState,
isRunning: shouldRestart,
shouldRenderTooltip: this.props.autoStart,
};

logger({
type: 'joyride:reset',
Expand Down

0 comments on commit 0dd249e

Please sign in to comment.