smartour
smartour copied to clipboard
Fixed run/next/prev methods
Thank you so much for your work!
I encountered a small error. In the current version, you can't use the prev() method if we are on the last slide.
https://github.com/jrainlau/smartour/blob/master/src/smartour.ts#L150 this.tourIndex of the last slide will always be equal to this.tourListLength - 1 and the prev() method will not switch to the previous slide.
I suggest using the run() method to run and switch to the next slide, the code logic will remain the same for the next() method.
There will be a separate code for the prev() method with this.tourIndex guard so that it won't switch to a non-existent slide.