Skip to content

Conversation

ScottF77
Copy link

Currently when a user triggers navigation clearHistory is automatically triggered but this can lead to a user being trapped when the navigation path is one they are already on, effectively they do not move anywhere but the history is empty.

To fix this I made the following changes

ns-router-links
Added check to see if clearHistory is set to false - if it is it is because it has been set this way and therefore remains false
If it has not been set or is true a check is run to see if the current path and target path are the same
If they are then clearHistory is set to false to retain the history

Other changes

ns-platform-location
Fixed typo

Fixed typo ns-router-links Added check to see if clearHistory is set to false If it is then it remains false If it has not been set or is true a check is run to see if the current path and target path are the same If they are then clearHistory is set to false
@ns-bot
Copy link

ns-bot commented Jul 10, 2017

Can one of the admins verify this patch?

@sis0k0
Copy link
Contributor

sis0k0 commented Jul 11, 2017

run ci

@NativeScript NativeScript deleted a comment from ns-bot Jul 12, 2017
@NativeScript NativeScript deleted a comment from ns-bot Jul 12, 2017
@NativeScript NativeScript deleted a comment from ns-bot Jul 12, 2017
@vakrilov
Copy link
Contributor

Hi @ScottF77
Thanks for the PR!

I'm think there might be the same issue when navigate to different URL which differs only in the params passed (ex /details/1 -> /details/2). In this case the angular navigation will only update the params passed to your component, but no actual navigation will be done. Clearing the history in this case will also cause trouble.

That said, can you please open an issue describing in detail what your problem is? We can discuss all possible scenarios there and eventually propose a more generic fix(PR) if it is needed.

@ScottF77
Copy link
Author

Hey @vakrilov thanks for your response, I have created an issue here - #894 if you need me to add to this then just let me know.

@dtopuzov
Copy link
Contributor

run ci

@ns-bot
Copy link

ns-bot commented Sep 18, 2017

Can one of the admins verify this patch?

@vakrilov
Copy link
Contributor

vakrilov commented Feb 7, 2018

Thanks for the effort @ScottF77!
It seems that the issue related to this PR is already closed.
Closing this PR - please reopen the issue if further info is available.

@vakrilov vakrilov closed this Feb 7, 2018
@ghost ghost removed the ♥ community PR label Feb 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

6 participants