Closed JudahGabriel closed 1 year ago
Thinking more on this, it might make more sense to add this logic in between here: https://github.com/thepassle/app-tools/blob/53784beeae2ab311f6355280fe5c0a93de138d1c/router/index.js#L126-L129
Makes sense. I wondered if there was a better way to handle this.
I'll update the PR.
I've updated the PR, moving the check to the anchor click handler like you suggested.
Thanks for the contribution!
Navigating to an external link (e.g. https://google.com) previously wouldn't actually navigate to that external link; it would try to match the fallback and navigate to that.
Additionally, navigating to a custom protocol (e.g. x-github-client://...) would throw an error as we tried to pushState() for different origins with the error,
This PR is a small change: if we try to navigate to a different host, we set window.location.href to the desired link.