mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-01-11 10:12:56 -05:00
Thibaut Girka
cc396f085d
Use history.state to decide whether we should goBack() or go to / (fixes #247)
So far, glitch-soc used history.length to decide whether to call `goBack()` or go to / in order to not leave the webUI. This made clicking the “Back” button go to the “Getting started” column instead of going back in the browser's history when such an action would leave the web UI, but also when: - The WebUI is refreshed (F5) - A tab is restored - The history length reaches its maximum (e.g., 50 in Firefox) This commit fixes these shortcomings by checking `window.history.state`. Indeed, we only want to go back in the browser's history when the current location has been reached from within the WebUI, which only happens via `pushState` as far as I know. Since browser store the serialized state in the browser history, this also survives page reload and session restoration.
Mastodon Glitch Edition
Now with automated deploys!
So here's the deal: we all work on this code, and then it runs on dev.glitch.social and anyone who uses that does so absolutely at their own risk. can you dig it?
- You can view documentation for this project at glitch-soc.github.io/docs/.
- And contributing guidelines are available here and here.
Description
Languages
Ruby
48.9%
JavaScript
26.4%
TypeScript
13.2%
SCSS
7.7%
Haml
3.4%
Other
0.4%