From f1bb23ba2a9b15f5c61e91b2d299eda130a3eae8 Mon Sep 17 00:00:00 2001 From: FreddleSpl0it Date: Fri, 16 Dec 2022 09:40:20 +0100 Subject: [PATCH] fix darkmode toggle --- data/web/js/build/015-mailcow.js | 4 ++-- data/web/js/site/index.js | 4 ++-- data/web/templates/base.twig | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/data/web/js/build/015-mailcow.js b/data/web/js/build/015-mailcow.js index 351b794c..2d7f9d82 100644 --- a/data/web/js/build/015-mailcow.js +++ b/data/web/js/build/015-mailcow.js @@ -304,13 +304,13 @@ $(document).ready(function() { $('#dark-mode-toggle').prop('checked', false); if ($('#rspamd_logo').length) $('#rspamd_logo').attr('src', '/img/rspamd_logo_dark.png'); if ($('#rspamd_logo_sm').length) $('#rspamd_logo_sm').attr('src', '/img/rspamd_logo_dark.png'); - localStorage.setItem('darkmode', 'false'); + localStorage.setItem('theme', 'light'); }else{ $('head').append(''); $('#dark-mode-toggle').prop('checked', true); if ($('#rspamd_logo').length) $('#rspamd_logo').attr('src', '/img/rspamd_logo_light.png'); if ($('#rspamd_logo_sm').length) $('#rspamd_logo_sm').attr('src', '/img/rspamd_logo_light.png'); - localStorage.setItem('darkmode', 'true'); + localStorage.setItem('theme', 'dark'); } } }); diff --git a/data/web/js/site/index.js b/data/web/js/site/index.js index cbbb1a44..4c812a37 100644 --- a/data/web/js/site/index.js +++ b/data/web/js/site/index.js @@ -1,5 +1,5 @@ $(document).ready(function() { - var darkmode = localStorage.getItem("darkmode"); + var theme = localStorage.getItem("theme"); localStorage.clear(); - localStorage.setItem("darkmode", darkmode); + localStorage.setItem("theme", theme); }); diff --git a/data/web/templates/base.twig b/data/web/templates/base.twig index 83860ad0..743a2b2d 100644 --- a/data/web/templates/base.twig +++ b/data/web/templates/base.twig @@ -11,8 +11,8 @@