-
Notifications
You must be signed in to change notification settings - Fork 364
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
fix(sw): support fixed id value #1197
Conversation
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
@@ -7,13 +7,17 @@ export default { | |||
title: "Intro/Playground", | |||
}; | |||
|
|||
localStorage.setItem("SANDPACK_INTERNAL:URL-CONSISTENT-ID", "123123123"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this needed? Should the user do this too?
const getStableServiceWorkerId = async () => { | ||
const key = `SANDPACK_INTERNAL:URL-CONSISTENT-ID`; | ||
const fixedId = localStorage.getItem(key); | ||
if (fixedId) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should do localStorage.setItem
for the id if it turns out it's not set (with a random id). Then we don't have to ask the user to set it.
…m/codesandbox/sandpack into fix/sw-consistent-id
No description provided.