Fork me on GitHub
#reitit
<
2020-03-13
>
worlds-endless15:03:58

No one with suggestions for handling back-button confirmation?

juhoteperi16:03:42

I don't think there is any great solution, but I've worked around this a few times. I've just called confirm on onhashchange, and then set location.hash back to the previous value if needed. Something like:

(if (and before-change-message (not (js/confirm before-change-message)))
        (if-let [p @previous-hash]
          (set! js/location.hash p))
        (dispatch [(keyword "frontend.routes" (name id)) route-data]))

worlds-endless21:03:56

This solution looks promising; however, since we're not using url-fragments, I need something other than location.hash, right?