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 clearStorage function to match expected behaviour #7006

Merged

Conversation

seralichtenhahn
Copy link
Contributor

@seralichtenhahn seralichtenhahn commented May 3, 2024

Resolves #7003

Changes:
The clearStorage() function previously cleared the entire localStorage including the data set outside of p5.js. This is not the expected behaviour, the documentation states that only data set by the storeItem() will get cleared.
This fix checks which data has been set with storeItem() and only removes the relevant data.

  • updated clearStorage() function
  • added unit test

PR Checklist

  • npm run lint passes
  • [Inline documentation] is included / updated
  • [Unit tests] are included / updated

Copy link

welcome bot commented May 3, 2024

🎉 Thanks for opening this pull request! Please check out our contributing guidelines if you haven't already. And be sure to add yourself to the list of contributors on the readme page!

@limzykenneth limzykenneth merged commit 63316d7 into processing:main May 4, 2024
2 checks passed
@limzykenneth
Copy link
Member

Looks good. Thanks!

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.

p5.prototype.clearStorage clears all items for the current domain, instead of items set with storeItem only
2 participants