From 6e2aec39c9027c68ed21bcfab3fa543e2f32fad8 Mon Sep 17 00:00:00 2001 From: cottongin Date: Wed, 26 Aug 2026 21:18:48 -0400 Subject: [PATCH] fix: use fresh settings in dark-mode observer and storage listener Co-authored-by: Cursor --- content/main.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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); } });