Skip to content

Commit

Permalink
Fix crash when using Blitz inside iframes (#2219)
Browse files Browse the repository at this point in the history
(patch)
  • Loading branch information
mtford90 authored Apr 14, 2021
1 parent fc216c2 commit ec5cc08
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/core/src/auth/public-data-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ class PublicDataStore {
// Setting the current time in ms will cause other tabs to receive the `storage` event
if (!opts?.suppressEvent) {
// Prevent infinite loop
localStorage.setItem(this.eventKey, Date.now().toString())
try {
localStorage.setItem(this.eventKey, Date.now().toString())
} catch (err) {
console.error("LocalStorage is not available", err)
}
}
this.observable.next(value ?? this.getData())
}
Expand Down

0 comments on commit ec5cc08

Please sign in to comment.