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
renamed clearStorage() to resetStorage()
onInstall event calls resetStorage() if no pre-existing data is present
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 toresetStorage()
was removed from theonInstall
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 thesetStorage()
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
clearStorage()
toresetStorage()
onInstall
event callsresetStorage()
if no pre-existing data is present