From 1b4b5706de9dd0e0225e9665577a5d78a556e60a Mon Sep 17 00:00:00 2001 From: cottongin Date: Wed, 26 Aug 2026 17:17:16 -0400 Subject: [PATCH] fix: mark per-subreddit mode dirty on color picker change Without this, new subreddit entries would not persist their color overrides because _dirtyModes was never set when picking via the custom color picker. Co-authored-by: Cursor --- popup/popup.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/popup/popup.js b/popup/popup.js index 99149ed..077cfd5 100644 --- a/popup/popup.js +++ b/popup/popup.js @@ -33,7 +33,7 @@ el.style.backgroundColor = val; } - function openPickerForSwatch(swatchEl) { + function openPickerForSwatch(swatchEl, onBeforeChange) { if (!picker) { picker = window.RedditTweaks.colorPicker.create(); } @@ -50,6 +50,7 @@ picker.open(getColorValue(swatchEl), function (hex) { setColorValue(swatchEl, hex); + if (onBeforeChange) onBeforeChange(); saveFromControls(); }); } @@ -161,7 +162,9 @@ [bgSwatch, borderSwatch, textSwatch].forEach(function (swatch) { swatch.addEventListener("click", function () { - openPickerForSwatch(swatch); + openPickerForSwatch(swatch, function () { + entry._dirtyModes[modeSelect.value] = true; + }); }); });