Skip to content

Commit

Permalink
moved creation of nextIndex to be just before it's needed
Browse files Browse the repository at this point in the history
  • Loading branch information
liam-jones-lucout committed May 25, 2022
1 parent 4d29661 commit 9496889
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/js/tour.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,10 +351,11 @@ export class Tour extends Evented {
*/
_skipStep(step, forward) {
const index = this.steps.indexOf(step);
const nextIndex = forward ? index + 1 : index - 1;

if (index === this.steps.length - 1) {
this.complete();
} else {
const nextIndex = forward ? index + 1 : index - 1;
this.show(nextIndex, forward);
}
}
Expand Down

0 comments on commit 9496889

Please sign in to comment.