syj67507 / github-pr-chrome-extension

Chrome Extension to fetch all open PR's
3 stars 1 forks source link

Bugfix: Resets Storage on Install #31

Closed syj67507 closed 8 months ago

syj67507 commented 8 months ago

Summary

In this PR, an issue where storage values could not be set has been resolved. The issue came from the fact that any setStorage() calls would error because the storage API didn't have an object initialized in place of where the values would be set.

Previously the clearStorage() (now renamed to resetStorage() was removed from the onInstall event of the background script to prevent pre-existing data from being cleared. This would mean that there was no object initialized for storage that caused the setStorage() calls to fail. Now this event will check to see if there is any pre-existing data, and call a reset to initialize the storage object if there isn't any.

Changes