Persist designer media preset across sessions#30
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9e7f5f2283
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (config && config.default_media) { | ||
| sel.value = config.default_media; | ||
| } | ||
| const saved = localStorage.getItem('ditherbooth_designer_media'); |
There was a problem hiding this comment.
Guard localStorage access for blocked storage
Accessing localStorage can throw a SecurityError in environments where storage is blocked or disabled (e.g., Safari private mode, strict privacy settings). This new read runs during initialization, so a thrown error would abort the designer setup and leave the page unusable in those contexts. Consider wrapping the access in a try/catch or feature-checking storage availability before reading.
Useful? React with 👍 / 👎.
Summary
localStorageon changeFixes #29
Test plan