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 <noreply@anthropic.com>
This commit is contained in:
Scarriffle
2026-07-07 10:32:34 +02:00
parent f844ded57d
commit 89a1355149
2 changed files with 5 additions and 5 deletions

View File

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