fix: Apple Calendar ignoring selection state, causing duplicate events
Apple calendar events were fetched from ALL calendars regardless of the user's Display checkbox selection. Now respects the stored selected state, matching the behavior of Synology/Google/Outlook providers. Also reverts the title-based deduplication which was too aggressive. v1.57.7 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
98f1c751e5
commit
3ec5a21714
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "my-weekly-todo-list",
|
"name": "my-weekly-todo-list",
|
||||||
"version": "1.57.6",
|
"version": "1.57.7",
|
||||||
"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,18 +1597,7 @@ export default function WeeklyView() {
|
|||||||
|
|
||||||
// Extend events with editable flag from connections
|
// Extend events with editable flag from connections
|
||||||
const calendarEvents = useMemo(() => {
|
const calendarEvents = useMemo(() => {
|
||||||
// Deduplicate events that appear in multiple calendars
|
return rawCalendarEvents.map((event) => {
|
||||||
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) {
|
||||||
|
|||||||
@ -371,7 +371,18 @@ export const getCalendarEvents = async (
|
|||||||
// It is: export const getUserCalendars = validateCredentials;
|
// It is: export const getUserCalendars = validateCredentials;
|
||||||
// validateCredentials: (email: string, appSpecificPassword: string)
|
// validateCredentials: (email: string, appSpecificPassword: string)
|
||||||
|
|
||||||
const calendars = await getAppleCalendars(email, appPassword);
|
const freshCalendars = await getAppleCalendars(email, appPassword);
|
||||||
|
|
||||||
|
// Use stored selection state if available, otherwise use all fresh calendars
|
||||||
|
let calendars = freshCalendars;
|
||||||
|
if (connection.calendars && Array.isArray(connection.calendars) && connection.calendars.length > 0) {
|
||||||
|
const storedCalendars = connection.calendars as any[];
|
||||||
|
// Only fetch from calendars that are selected
|
||||||
|
calendars = freshCalendars.filter(fc => {
|
||||||
|
const stored = storedCalendars.find((sc: any) => sc.id === fc.id);
|
||||||
|
return stored ? stored.selected !== false : true;
|
||||||
|
});
|
||||||
|
}
|
||||||
const calendarIds = calendars.map(c => c.id);
|
const calendarIds = calendars.map(c => c.id);
|
||||||
|
|
||||||
// Fetch events for each calendar
|
// Fetch events for each calendar
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user