]> cat aescling's git repositories - mastodon.git/commitdiff
Only localize js when there's a theme
authorkibigo! <marrus-sh@users.noreply.github.com>
Fri, 8 Dec 2017 03:41:57 +0000 (19:41 -0800)
committerkibigo! <marrus-sh@users.noreply.github.com>
Sun, 10 Dec 2017 19:08:04 +0000 (11:08 -0800)
app/views/layouts/application.html.haml

index 4d32c50353b7ad6caac38dfb035abdd35a80932c..20603678b41c8bf947a88364555509f268eff4f3 100755 (executable)
       = title
 
     = javascript_pack_tag "locales", integrity: true, crossorigin: 'anonymous'
-    - if @theme[:supported_locales].include? I18n.locale.to_s
-      = javascript_pack_tag "locales/#{@theme[:flavour]}/#{I18n.locale}", integrity: true, crossorigin: 'anonymous'
-    - elsif @theme[:supported_locales].include? 'en'
-      = javascript_pack_tag "locales/#{@theme[:flavour]}/en", integrity: true, crossorigin: 'anonymous'
+    - if @theme
+      - if @theme[:supported_locales].include? I18n.locale.to_s
+        = javascript_pack_tag "locales/#{@theme[:flavour]}/#{I18n.locale}", integrity: true, crossorigin: 'anonymous'
+      - elsif @theme[:supported_locales].include? 'en'
+        = javascript_pack_tag "locales/#{@theme[:flavour]}/en", integrity: true, crossorigin: 'anonymous'
     = csrf_meta_tags
 
     = yield :header_tags