Skip to content

Commit 37a0a62

Browse files
committed
Catch exception thrown by localStorage.setItem
This happens in Safari when in private browsing.
1 parent 51c5cf8 commit 37a0a62

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

js/app.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@ if (parseSearch().value || parseHash().id_token) {
3131

3232
}
3333

34-
localStorage.setItem("visited", "1");
34+
try {
35+
localStorage.setItem("visited", "1");
36+
} catch (e) {
37+
// Safari when in private browsing doesn't allow it
38+
}
3539

3640
/*
3741
* Show menu mobile

0 commit comments

Comments
 (0)