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

impossible to go back when visiting address page #814

Closed
chappjc opened this issue Nov 13, 2018 · 7 comments
Closed

impossible to go back when visiting address page #814

chappjc opened this issue Nov 13, 2018 · 7 comments
Assignees
Milestone

Comments

@chappjc
Copy link
Member

chappjc commented Nov 13, 2018

When clicking an address from a transaction view, you are sent to the address page with no hash tag/#anchor, but the address page immediately redirects to #list-view, making a new browser history entry.

That is,

Going to http://127.0.0.1:7777/tx/38a9c89aaa3445333c2ca1542c16d21ca33c946715a8e605e91f687df06e38e7 and clicking the first output's address:

http://127.0.0.1:7777/address/DsRZ8itu7XEkBNELzcJ4xKLapswhquKquUn

then takes you to:

http://127.0.0.1:7777/address/DsRZ8itu7XEkBNELzcJ4xKLapswhquKquUn#list-view

Then if you click back, you cannot get to the /tx page because it takes you to the /address page, which immediately redirects to the #list-view address page.

The issue seems to be with:

history.pushState({},  this.addr, "#" + _this.defaultHash);

Perhaps we should be using replaceState instead: https://developer.mozilla.org/en-US/docs/Web/API/History_API#The_replaceState()_method

@chappjc chappjc added this to the 3.1 milestone Nov 13, 2018
@chappjc chappjc added the bug label Nov 13, 2018
@chappjc
Copy link
Member Author

chappjc commented Nov 13, 2018

Another related issue is that using the browser's <- and -> buttons to go through the different address pages #anchors is not possible.

@chappjc
Copy link
Member Author

chappjc commented Nov 13, 2018

Partially resolved by PR #815, but the general navigation issues mentioned above are not resolved. Perhaps we should not be using the history API and instead use turbolinks?

@ZeroASIC
Copy link
Contributor

ZeroASIC commented Nov 27, 2018

On dcrdata.org I never get forwarded to #list-view. I tested it in Chrome and Firefox. Is this a problem with the development version but not the live version?
https://explorer.dcrdata.org/tx/38a9c89aaa3445333c2ca1542c16d21ca33c946715a8e605e91f687df06e38e7
Edit: The problem exists on alpha.dcrdata.org

@chappjc
Copy link
Member Author

chappjc commented Nov 28, 2018 via email

@ZeroASIC
Copy link
Contributor

Yeah I noticed that on alpha. I looked at a little bit yesterday and I think I could probably fix this. Using the URL to contain information this way is the real culprit. It should be based on the state of the html elements.

@chappjc
Copy link
Member Author

chappjc commented Nov 28, 2018

Great to hear. @buck54321 has a solution brewing too. Perhaps you can discuss it with him.

@chappjc
Copy link
Member Author

chappjc commented Dec 10, 2018

Resolved by #870

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

4 participants