Skip to content

Add Storage API persistence to protect calendar data - #12

Open
prybalko wants to merge 1 commit into
vas3k:mainfrom
prybalko:use-storage-persistant-api
Open

Add Storage API persistence to protect calendar data#12
prybalko wants to merge 1 commit into
vas3k:mainfrom
prybalko:use-storage-persistant-api

Conversation

@prybalko

Copy link
Copy Markdown
Contributor

Add Storage API persistence to protect calendar data

Summary

Requests persistent storage using navigator.storage.persist() to reduce the risk of browsers automatically clearing user calendar data.

Changes

  • Added useEffect hook in CalendarContext.tsx to request persistent storage on app load
  • Logs persistence status to console for debugging
  • Gracefully handles browsers that don't support the Storage API

Benefits

  • Browser is less likely to evict localStorage data under storage pressure

Notes

Browsers typically grant persistence based on user engagement (bookmarking, frequent visits, PWA installation). The app continues to work normally whether persistence is granted or denied.

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.

1 participant