@bigbinary/neeto-commons-frontend 2.0.113 → 2.0.115

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/react-utils.js CHANGED
@@ -3514,8 +3514,13 @@ var useKeyboardShortcutsPaneState = function useKeyboardShortcutsPaneState() {
3514
3514
  };
3515
3515
 
3516
3516
  var getStorageValue = function getStorageValue(key, defaultValue) {
3517
- if (key in localStorage) return JSON.parse(localStorage.getItem(key));
3518
- return defaultValue;
3517
+ try {
3518
+ var storedValue = localStorage.getItem(key);
3519
+ return storedValue ? JSON.parse(storedValue) : defaultValue;
3520
+ } catch (error) {
3521
+ logger.error(error);
3522
+ return defaultValue;
3523
+ }
3519
3524
  };
3520
3525
  var useLocalStorage = function useLocalStorage(key, defaultValue) {
3521
3526
  var _useState = useState(function () {