Fix applying dark forest theme

pull/3333/head
Victor Baranov 4 years ago
parent 02763e06dd
commit feb51ce06f
  1. 18
      apps/block_scout_web/lib/block_scout_web/templates/layout/app.html.eex
  2. 2
      apps/block_scout_web/priv/gettext/default.pot
  3. 2
      apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po

@ -39,14 +39,16 @@
<% raw_dark_forest_addresses = CustomContractsHelpers.get_raw_dark_forest_addresses_list() %> <% raw_dark_forest_addresses = CustomContractsHelpers.get_raw_dark_forest_addresses_list() %>
<script> <script>
function applyCustomMode() { function applyCustomMode() {
const darkForestContractAddressHashes = "<%= raw_dark_forest_addresses %>".split(',').map(hash => hash.toLowerCase()) const darkForestContractAddressHashesRaw = "<%= raw_dark_forest_addresses %>"
if (darkForestContractAddressHashesRaw !== "") {
darkForestContractAddressHashes.forEach(darkForestContractAddressHash => { const darkForestContractAddressHashes = darkForestContractAddressHashesRaw.split(',').map(hash => hash.toLowerCase())
if (window.location.pathname.toLowerCase().includes(darkForestContractAddressHash)) { darkForestContractAddressHashes.forEach(darkForestContractAddressHash => {
document.body.className += " " + "dark-forest-theme-applied"; if (window.location.pathname.toLowerCase().includes(darkForestContractAddressHash)) {
return; document.body.className += " " + "dark-forest-theme-applied";
} return;
}) }
})
}
} }
function applyDarkMode() { function applyDarkMode() {
if (localStorage.getItem("current-color-mode") === "dark") { if (localStorage.getItem("current-color-mode") === "dark") {

@ -72,7 +72,7 @@ msgid "(query)"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/layout/app.html.eex:68 #: lib/block_scout_web/templates/layout/app.html.eex:70
msgid "- We're indexing this chain right now. Some of the counts may be inaccurate." msgid "- We're indexing this chain right now. Some of the counts may be inaccurate."
msgstr "" msgstr ""

@ -72,7 +72,7 @@ msgid "(query)"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/layout/app.html.eex:68 #: lib/block_scout_web/templates/layout/app.html.eex:70
msgid "- We're indexing this chain right now. Some of the counts may be inaccurate." msgid "- We're indexing this chain right now. Some of the counts may be inaccurate."
msgstr "" msgstr ""

Loading…
Cancel
Save