summaryrefslogtreecommitdiff
path: root/app/views/layouts/application.html.erb
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-08-18 01:49:17 +0200
committererdgeist <erdgeist@erdgeist.org>2026-08-18 01:49:17 +0200
commitedf0d64aa2c837b4bb28787483f98cb4815601c2 (patch)
treef8d2984b46cc3a62dbae4498aaf5b214d8228b14 /app/views/layouts/application.html.erb
parent0e15d4461cc9b8e8baeeab2288ef8bbc2d30c3e6 (diff)
Wrap localStorage access in try/catch
Diffstat (limited to 'app/views/layouts/application.html.erb')
-rw-r--r--app/views/layouts/application.html.erb6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb
index 4a71011b..756b4bdd 100644
--- a/app/views/layouts/application.html.erb
+++ b/app/views/layouts/application.html.erb
@@ -22,8 +22,10 @@
22 22
23 <%= javascript_tag nonce: true do %> 23 <%= javascript_tag nonce: true do %>
24 document.addEventListener("DOMContentLoaded", function() { 24 document.addEventListener("DOMContentLoaded", function() {
25 if (localStorage.getItem('override-prefers-color-scheme')) 25 try {
26 document.getElementById("light-mode").checked = true; 26 if (localStorage.getItem('override-prefers-color-scheme'))
27 document.getElementById("light-mode").checked = true;
28 } catch (e) {}
27 }); 29 });
28 <% end %> 30 <% end %>
29 31