fix: use fresh settings in dark-mode observer and storage listener
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user