Skip to content

Commit

Permalink
Merge pull request #199 from aanaya-deltacom/patch-1
Browse files Browse the repository at this point in the history
fix: removeOnUndefined option using Angular Universal
  • Loading branch information
BBlackwo authored Aug 24, 2021
2 parents 241e7bf + fd2f4aa commit 49183fd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion projects/lib/src/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ export const syncStateUpdate = (
} catch (e) {
console.warn('Unable to save state to localStorage:', e);
}
} else if (typeof stateSlice === 'undefined' && removeOnUndefined) {
} else if (typeof stateSlice === 'undefined' && removeOnUndefined && storage !== undefined) {
try {
storage.removeItem(storageKeySerializer(key as string));
} catch (e) {
Expand Down

0 comments on commit 49183fd

Please sign in to comment.