Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
yeah I considered adding that state, but thought that might give away too much, considering how the OP wants us to write the FSM for him, instead of asking how to fix his broken implementation after trying to make it work on his own (perhaps even learning something on the way). ;-)