mastodon/app/javascript/flavours/glitch/util
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.
2018-05-31 14:39:02 +02:00
..
emoji WIP <Compose> Refactor; Fin~ 2018-01-04 21:17:30 -08:00
api.js Refactor /api/web APIs to use the centralized axios instance (tootsuite pr #6223) 2018-01-09 10:51:14 -06:00
async-components.js Add glitch-soc front-end support for bookmarks 2018-04-11 21:05:34 +02:00
base_polyfills.js Rename themes -> flavours ? ? 2017-12-03 23:26:40 -08:00
bio_metadata.js Style fixes to make eslint happier, hopefully 2018-01-18 09:13:07 -06:00
compare_id.js [Glitch] Fix comparing id 2018-05-29 21:25:28 +02:00
counter.js Rename themes -> flavours ? ? 2017-12-03 23:26:40 -08:00
dom_helpers.js WIP <Compose> Refactor; <Drawer> ed. 2018-01-04 18:21:59 -08:00
extra_polyfills.js Rename themes -> flavours ? ? 2017-12-03 23:26:40 -08:00
fullscreen.js Rename themes -> flavours ? ? 2017-12-03 23:26:40 -08:00
get_rect_from_entry.js Rename themes -> flavours ? ? 2017-12-03 23:26:40 -08:00
html.js [Glitch] Use plaintext value for field value tooltips in web UI 2018-05-10 14:11:23 +02:00
initial_state.js [Glitch] Handle preference to always display sensitive media 2018-04-14 12:27:14 +02:00
intersection_observer_wrapper.js Rename themes -> flavours ? ? 2017-12-03 23:26:40 -08:00
is_mobile.js Rename themes -> flavours ? ? 2017-12-03 23:26:40 -08:00
js_helpers.js Threaded mode~ 2018-01-05 21:16:43 -08:00
link_header.js Rename themes -> flavours ? ? 2017-12-03 23:26:40 -08:00
load_polyfills.js Rename themes -> flavours ? ? 2017-12-03 23:26:40 -08:00
main.js Use history.state to decide whether we should goBack() or go to / (fixes #247) 2018-05-31 14:39:02 +02:00
optional_motion.js Rename themes -> flavours ? ? 2017-12-03 23:26:40 -08:00
performance.js Rename themes -> flavours ? ? 2017-12-03 23:26:40 -08:00
react_helpers.js WIP <Compose> Refactor; 1000 tiny edits 2018-01-04 18:33:13 -08:00
react_router_helpers.js [Glitch] Add "Toots/Toots with replies/Media" tab below profile header 2018-03-16 23:16:20 +01:00
ready.js Rename themes -> flavours ? ? 2017-12-03 23:26:40 -08:00
reduced_motion.js Rename themes -> flavours ? ? 2017-12-03 23:26:40 -08:00
redux_helpers.js WIP <Compose> Refactor; 1000 tiny edits 2018-01-04 18:33:13 -08:00
resize_image.js Implement client-size image resizing from upstream 2018-05-27 11:02:54 +02:00
rtl.js Rename themes -> flavours ? ? 2017-12-03 23:26:40 -08:00
schedule_idle_task.js Rename themes -> flavours ? ? 2017-12-03 23:26:40 -08:00
scroll.js Rename themes -> flavours ? ? 2017-12-03 23:26:40 -08:00
settings.js web push updates (tootsuite PRs #5879, #5941, #6047) 2017-12-30 11:45:01 -06:00
stream.js [Glitch] Use randomized setTimeout when fallback-polling and re-add since_id 2018-05-29 21:25:28 +02:00
url_regex.js Style fixes to make eslint happier, hopefully 2018-01-18 09:13:07 -06:00
uuid.js Rename themes -> flavours ? ? 2017-12-03 23:26:40 -08:00