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

feat(server-routes): implement persisting input values in localStorage #545

Merged
merged 3 commits into from
Dec 27, 2023

Conversation

arashsheyda
Copy link
Member

Screen.Recording.2023-12-16.at.9.10.16.PM.mov

Copy link

cloudflare-workers-and-pages bot commented Dec 17, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6a759d0
Status: ✅  Deploy successful!
Preview URL: https://2e6a691a.nuxt-devtools.pages.dev
Branch Preview URL: https://feat-sr-inputs-localstorage.nuxt-devtools.pages.dev

View logs

@atinux
Copy link
Member

atinux commented Dec 18, 2023

Shall we also remember the active tab for each route?

@arashsheyda
Copy link
Member Author

@atinux For sure!

Copy link
Member

atinux commented Dec 20, 2023

Looks good to me! I let @antfu do the final review

@@ -308,6 +308,50 @@ watchEffect(() => {
}
})

const savedRouteInputs = useLocalStorage<{ path: string, tab: string, inputs: any }[]>('nuxt-devtools:server-routes:inputs', () => [], {
window: window.parent,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason to pass the parent window here? It should work with iframe window as they are same origin.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While trying out with my laptop(windows 10), the storage wasn't working as expected(the client would get reset after a page refresh)
Is it possible for you to test it out?

@antfu antfu merged commit 67dbf65 into main Dec 27, 2023
3 checks passed
@antfu antfu deleted the feat/sr-inputs-localstorage branch December 27, 2023 14:37
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