Skip to content

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

@welcome
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
@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