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:
@@ -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 });
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
// Increment APP_VERSION with every code change
|
||||
export const APP_VERSION = 'v80';
|
||||
export const APP_VERSION = 'v81';
|
||||
|
||||
Reference in New Issue
Block a user