-
Notifications
You must be signed in to change notification settings - Fork 94
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
Persist popup open/close state to avoid closing it every page refresh #419
base: main
Are you sure you want to change the base?
Conversation
Store userCollapsed in sessionStorage to avoid closing it every page refresh
✅ Deploy Preview for vite-plugin-checker ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
packages/runtime/src/App.ce.vue
Outdated
@@ -44,10 +44,11 @@ if (props?.overlayConfig?.initialIsOpen === 'error') { | |||
}) | |||
} | |||
|
|||
const userCollapsed = ref<boolean | undefined>(undefined) | |||
const userCollapsed = ref<boolean>(sessionStorage.userCollapsed === "true") |
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.
great idea, can you change name to something more unique to avoid potential conflicts?
maybe something like vite_checker_overlay_collapsed
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.
Sure, Done
commit: |
Store userCollapsed in sessionStorage to avoid closing it every page refresh.
NOTE: you can improve the PR making it configurable, store it in another sessionStorage[KEY].