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 <noreply@anthropic.com>
This commit is contained in:
parent
af46c0c21f
commit
98f1c751e5
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "my-weekly-todo-list",
|
"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",
|
"description": "A web-based weekly task management application that organizes to-dos and calendar events in a single, intuitive weekly view",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@ -1597,7 +1597,18 @@ export default function WeeklyView() {
|
|||||||
|
|
||||||
// Extend events with editable flag from connections
|
// Extend events with editable flag from connections
|
||||||
const calendarEvents = useMemo(() => {
|
const calendarEvents = useMemo(() => {
|
||||||
return rawCalendarEvents.map((event) => {
|
// Deduplicate events that appear in multiple calendars
|
||||||
|
const seen = new Set<string>();
|
||||||
|
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;
|
let isEditable = false;
|
||||||
if (event.calendarId) {
|
if (event.calendarId) {
|
||||||
for (const conn of connections) {
|
for (const conn of connections) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user