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

fix(sw): support fixed id value #1197

Merged
merged 4 commits into from
Sep 10, 2024
Merged

fix(sw): support fixed id value #1197

merged 4 commits into from
Sep 10, 2024

Conversation

danilowoz
Copy link
Member

No description provided.

Copy link

codesandbox bot commented Sep 10, 2024

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

Copy link

vercel bot commented Sep 10, 2024

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

Name Status Preview Comments Updated (UTC)
sandpack-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 10, 2024 10:10am
sandpack-landing 🔄 Building (Inspect) Visit Preview 💬 Add feedback Sep 10, 2024 10:10am
sandpack-theme 🔄 Building (Inspect) Visit Preview 💬 Add feedback Sep 10, 2024 10:10am

Copy link

codesandbox-ci bot commented Sep 10, 2024

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");
Copy link
Member

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) {
Copy link
Member

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.

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.

3 participants