fix(calendar): produce correct JMAP patch when removing recurrence rules
Include recurrenceRules, recurrenceOverrides, and excludedRecurrenceRules in the update patch when clearing recurrence from an event. Also fix "this and future" scope overriding user's recurrence changes. Fixes #14
This commit is contained in:
@@ -237,6 +237,8 @@ export function EventModal({
|
||||
relativeTo: null,
|
||||
},
|
||||
};
|
||||
} else if (isEdit && event?.locations && Object.keys(event.locations).length > 0) {
|
||||
data.locations = null;
|
||||
}
|
||||
|
||||
if (recurrence !== "none") {
|
||||
@@ -259,6 +261,10 @@ export function EventModal({
|
||||
count: null,
|
||||
until: null,
|
||||
}];
|
||||
} else if (isEdit && event?.recurrenceRules?.length) {
|
||||
data.recurrenceRules = null;
|
||||
if (event.recurrenceOverrides) data.recurrenceOverrides = null;
|
||||
if (event.excludedRecurrenceRules) data.excludedRecurrenceRules = null;
|
||||
}
|
||||
|
||||
if (alert !== "none") {
|
||||
@@ -272,6 +278,8 @@ export function EventModal({
|
||||
relatedTo: null,
|
||||
},
|
||||
};
|
||||
} else if (isEdit && event?.alerts && Object.keys(event.alerts).length > 0) {
|
||||
data.alerts = null;
|
||||
}
|
||||
|
||||
if (attendees.length > 0 && currentUserEmails.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user