From ce5dfa72c6151bd0a3a02de5bfac1399f7dccb00 Mon Sep 17 00:00:00 2001 From: Kibi Kelburton Date: Thu, 16 Jul 2026 22:16:00 +0200 Subject: [PATCH] perstistency... --- public/s/js/f0ckm.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/public/s/js/f0ckm.js b/public/s/js/f0ckm.js index 70ba68c..01225ed 100644 --- a/public/s/js/f0ckm.js +++ b/public/s/js/f0ckm.js @@ -557,8 +557,15 @@ window.cancelAnimFrame = (function () { // For guests: fall back to cookie (no session = cookie is the only persistence). if (window.f0ckSession && window.f0ckSession.logged_in && window.f0ckSession.mode !== undefined) { window.activeMode = +window.f0ckSession.mode; - // Reconcile the local cookie so future reads are consistent on this device + // Reconcile the local mode cookie so future reads are consistent on this device document.cookie = `mode=${window.activeMode}; Path=/; Max-Age=31536000`; + // If the authoritative mode is ALL (3), also clear any stale ratings cookie. + // Otherwise a ratings=sfw cookie left from a previous device's filter would make + // the badge and button UI show the wrong state (even though the server ignores + // the ratings cookie when mode=3). + if (window.activeMode === 3) { + document.cookie = 'ratings=; Path=/; Max-Age=0'; + } } else { const _modeCookieRaw = document.cookie.split('; ').find(r => r.startsWith('mode=')); if (_modeCookieRaw) {