actmd / abraham

Trackable application tours for Rails with i18n support
MIT License
124 stars 45 forks source link

Feature/check cookie in start #27

Closed rroppolo closed 4 years ago

rroppolo commented 4 years ago

We need a way to start a tour from a user action. In this case, the user clicks a toggle button (built as a React component) and the click causes a tour to appear.

In order to honor the Abraham "later" cookie to only show the tour once per session, we need the start method to check the cookie when it is called after the page has loaded. In this PR we wrap the existing start method with a wrapper function that checks the cookie status.

jabbett commented 4 years ago

(Whoops, didn't mean for GitHub to merge into master... will fix on command line!)