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

Do a full reload when tab is restored #978

Merged
merged 1 commit into from
Mar 21, 2023

Conversation

kognise
Copy link
Member

@kognise kognise commented Mar 20, 2023

Firefox has weird tab restoring logic. When you, for example, Ctrl-Shift-T, it opens a kinda broken cached version of the page. And for some reason this reverts the CM state. Seems like manipulating Preact state is unpredictable, but sessionStorage is saved, so we use a random token to detect if the page is being restored and force a reload.

Fixes #919.

@kognise kognise self-assigned this Mar 20, 2023
@vercel
Copy link

vercel bot commented Mar 20, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
sprig ✅ Ready (Inspect) Visit Preview Mar 20, 2023 at 6:40PM (UTC)

@leomcelroy leomcelroy merged commit bf81543 into main Mar 21, 2023
@leomcelroy leomcelroy deleted the kognise/tab-restore-force-reload branch March 21, 2023 03:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sprig code editor V2 not saving things properly on firefox on linux
2 participants