From 89a1355149fb807f87ddd77419442b0af8284ef8 Mon Sep 17 00:00:00 2001 From: Scarriffle Date: Tue, 7 Jul 2026 10:32:34 +0200 Subject: [PATCH] fix(web): inverted condition broke hiding shared calendars The per-device hide branch was gated on owned!==false (my own calendars) instead of owned===false (shared with me), so unchecking a shared calendar hit the owner-only enabled PUT and 404'd. Swap to owned===false. Co-Authored-By: Claude Opus 4.8 --- frontend/js/calendar.js | 8 ++++---- frontend/js/version.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/js/calendar.js b/frontend/js/calendar.js index 2ae72b2..4688691 100644 --- a/frontend/js/calendar.js +++ b/frontend/js/calendar.js @@ -866,10 +866,10 @@ function renderCalendarList() { } else if (source === 'local') { const calId = parseInt(cb.dataset.calId); const cal = state.localCalendars.find(c => c.id === calId); - // `enabled` is the owner's property — only the owner may PUT it. - // For calendars shared with me, persist a per-device hide instead so it - // survives refetches (the server keeps returning the owner's events). - if (cal && cal.owned !== false) { + // `enabled` is the owner's property — only the owner may PUT it. For + // calendars shared with me (owned === false), persist a per-device hide + // instead so it survives refetches (the server keeps returning them). + if (cal && cal.owned === false) { setHiddenLocalCal(calId, !cb.checked); } else { await api.put(`/local/calendars/${calId}`, { enabled: cb.checked }); diff --git a/frontend/js/version.js b/frontend/js/version.js index de5a96b..f685387 100644 --- a/frontend/js/version.js +++ b/frontend/js/version.js @@ -1,2 +1,2 @@ // Increment APP_VERSION with every code change -export const APP_VERSION = 'v80'; +export const APP_VERSION = 'v81';