Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
illfixit authored Oct 4, 2024
1 parent c298c50 commit 1cf6bc5
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/app/core/utils/local-storage-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,7 @@ export class LocalStorageUtils {
const storedItem = localStorage.getItem(key);

try {
if (storedItem == null) {
this.saveData(key, defaultValue);
return defaultValue;
} else {
return JSON.parse(storedItem);
}
return storedItem == null ? defaultValue : JSON.parse(storedItem);
} catch (e) {
console.warn('Error parsing local storage value', key, storedItem);
return defaultValue;
Expand Down

0 comments on commit 1cf6bc5

Please sign in to comment.