Skip to content
This repository has been archived by the owner on Mar 9, 2018. It is now read-only.

removeQuery does not remove last query parameter #20

Closed
muonoum opened this issue Apr 19, 2016 · 1 comment
Closed

removeQuery does not remove last query parameter #20

muonoum opened this issue Apr 19, 2016 · 1 comment

Comments

@muonoum
Copy link
Contributor

muonoum commented Apr 19, 2016

Trying to remove the last query parameter with removeQuery while on / and without a basePath defined does not change the path. This is caused by History.send receiving an empty string which results in an empty path argument to window.history.replaceState. I guess this behaviour is correct for the History module, but it is probably wrong in the context of removeQuery.

The following change seems to solve the issue in my application, although there might be some unintended side effects that I'm unaware of:

[https://github.com/spektroskop/hop/commit/634a4b2d9b4e02ebc2d48e4836ec12acee7d5107]

If this is an acceptable solution I can submit a pull request.

@sporto
Copy link
Owner

sporto commented Apr 19, 2016

I see, good catch, this never occurred to me. Your change looks good, I cannot think of a side effect right now. Happy to take a PR on this, thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants