diff --git a/content/main.js b/content/main.js index 4b86c4f..01e0714 100644 --- a/content/main.js +++ b/content/main.js @@ -3,16 +3,16 @@ function startDarkModeObserver(settings) { var observer = new MutationObserver(function () { - if (settings.darkMode === "auto") { - window.RedditTweaks.loadSettings().then(function (updated) { - if (settings.badgeLayout) { + window.RedditTweaks.loadSettings().then(function (updated) { + if (updated.darkMode === "auto") { + if (updated.badgeLayout) { window.RedditTweaks.badgeTweak.updateColors(updated); } - if (settings.cardLayout) { + if (updated.cardLayout) { window.RedditTweaks.cardTweak.updateSettings(updated); } - }); - } + } + }); }); observer.observe(document.body, { @@ -86,10 +86,10 @@ } window.RedditTweaks.loadSettings().then(function (updated) { - if (settings.badgeLayout) { + if (updated.badgeLayout) { window.RedditTweaks.badgeTweak.updateColors(updated); } - if (settings.cardLayout) { + if (updated.cardLayout) { window.RedditTweaks.cardTweak.updateSettings(updated); } });