diff --git a/src/invidious/views/template.ecr b/src/invidious/views/template.ecr index 9904b4fc..2263f8e9 100644 --- a/src/invidious/views/template.ecr +++ b/src/invidious/views/template.ecr @@ -1,8 +1,12 @@ -<% - locale = env.get("preferences").as(Preferences).locale - dark_mode = env.get("preferences").as(Preferences).dark_mode -%> +<%- + user = env.get?("user").try &.as(IV::User) + prefs = env.get?("preferences").try &.as(Preferences) + + locale = prefs.try &.locale || "en-US" + dark_mode = prefs.try &.dark_mode || "auto" + show_nick = prefs.try &.show_nick || false +-%>
@@ -40,7 +44,7 @@ <% end %>