loomchild / sojourner-web

FOSDEM conference companion PWA
https://sojourner.rocks
GNU Affero General Public License v3.0
50 stars 6 forks source link

Back button shouldn't go back to a different site #141

Closed thibaultmol closed 6 months ago

thibaultmol commented 7 months ago

Steps to repro: Go to a random website, then go to a specific page on the sojourner site like: https://fosdem.sojourner.rocks/2024/type/Main%20tracks Then click the back button in the website's ui

What I expect to happen: goes to homepage of the sojourner site What actually happens: you get back to the previous site you were on.

loomchild commented 6 months ago

Thanks for your suggestion.

Actually, it's not trivial, since I can't simply peek what's the previous page in history.

I managed to implement it via history.state, but it's not 100% perfect, since if the user refreshes the page, the back button will go back to the dashboard instead of followin the history. But I think it's still worth it.

Please check and let me know what do you think.

thibaultmol commented 6 months ago

Works as expected now :+1: