From 98f1c751e5326856249610c71aba306668866851 Mon Sep 17 00:00:00 2001 From: mARTin Date: Mon, 23 Mar 2026 00:03:47 +0100 Subject: [PATCH] fix: deduplicate calendar events appearing in multiple calendars Events with the same title, start, and end time from different calendars are now shown only once instead of duplicated in the all-day and time grid. v1.57.6 Co-Authored-By: Claude Opus 4.6 --- package.json | 2 +- src/components/WeeklyView.tsx | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 8f080d8..e9d5aac 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "my-weekly-todo-list", - "version": "1.57.5", + "version": "1.57.6", "description": "A web-based weekly task management application that organizes to-dos and calendar events in a single, intuitive weekly view", "main": "index.js", "scripts": { diff --git a/src/components/WeeklyView.tsx b/src/components/WeeklyView.tsx index f2a2162..b007170 100644 --- a/src/components/WeeklyView.tsx +++ b/src/components/WeeklyView.tsx @@ -1597,7 +1597,18 @@ export default function WeeklyView() { // Extend events with editable flag from connections const calendarEvents = useMemo(() => { - return rawCalendarEvents.map((event) => { + // Deduplicate events that appear in multiple calendars + const seen = new Set(); + const deduped = rawCalendarEvents.filter((event) => { + const startVal = event.start?.dateTime || event.start?.date || ""; + const endVal = event.end?.dateTime || event.end?.date || ""; + const key = `${event.title}|${startVal}|${endVal}`; + if (seen.has(key)) return false; + seen.add(key); + return true; + }); + + return deduped.map((event) => { let isEditable = false; if (event.calendarId) { for (const conn of connections) {