Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

One of queries is undefined and watch $route will fire twice #1722

Closed
webrsb opened this issue Sep 7, 2017 · 4 comments
Closed

One of queries is undefined and watch $route will fire twice #1722

webrsb opened this issue Sep 7, 2017 · 4 comments

Comments

@webrsb
Copy link

webrsb commented Sep 7, 2017

Version

2.0.1 or higher

Reproduction link

http://jsfiddle.net/xvs5euab/2/

Steps to reproduce

Click first link (foo_undefined)

What is expected?

Same as next link "foo_bar", just show alarm only one time

What is actually happening?

It show alarm two times

@posva
Copy link
Member

posva commented Sep 7, 2017

Once #1568 is merged, you can use null, but I really think you shouldn't use undefined as your query values. For the moment, you can delete them or simply not include them. I'm marking this as an improvement but I really recommend you to not include query's parameters that are undefined, it better to remove them

@webrsb
Copy link
Author

webrsb commented Sep 8, 2017

Thanks for providing advice. In some case, query's parameters may be removed by user from URL that I can't prevent it.

@posva
Copy link
Member

posva commented Sep 8, 2017

If the property is not in the query it won't trigger the watcher twice. The reason it happens twice right now is because the query gets normalized

@posva
Copy link
Member

posva commented Sep 20, 2017

Note: Would be good to prevent normalization from triggering the navigation twice

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

No branches or pull requests

2 participants