Files
compiler-explorer/static
Matt Godbolt 145de8c478 Use session _then_ local storage for saved state
In conversation with @mknejp he pointed out that it can be frustating
when having a browser loaded up with many tabs of CE links, then reloading
the browser (e.g. a reboot, or open/closing the tabs), that upon reload all
the tabs will have the same, shared state (corresponding to whichever saved
to local storage last).

This change:
- stores state in _both_ session and local storage
- removes from both on UI reset
- loads first from session storage and then falls back to local storage

The net result is:
- tabs reopened with "ctrl-shift T" will regain their prior state, as do
  any other tabs for which the browser thinks are part of the same session
  (like on a "reopen tabs" plugins etc)
- newly-opened tabs still have the prior behaviour of using whatever the
  most recently opened tab had as its starting state

Some more info on session vs local storage [here](https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage)
2023-07-23 14:26:17 -05:00
..
2023-01-15 20:19:41 -05:00
2023-07-18 02:26:35 +02:00
2023-07-10 21:31:04 -05:00
2023-06-18 15:21:50 -04:00
2023-04-01 00:52:27 -04:00
2023-06-18 15:21:50 -04:00
2023-06-19 22:13:45 -04:00
2023-07-10 21:31:04 -05:00
2023-07-10 21:31:04 -05:00
2023-07-10 21:31:04 -05:00
2023-07-10 21:31:04 -05:00