fix: use fresh settings in dark-mode observer and storage listener

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-26 21:18:48 -04:00
parent 7b0c80c0a4
commit 6e2aec39c9

View File

@@ -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);
}
});