Merge pull request #1312 from cryptpad/bugfix-calendar-stop-recurrence

Fix a bug with stopping the recurrence of a calendar event
This commit is contained in:
yflory 2023-11-14 16:44:34 +01:00 committed by GitHub
commit c57f786c4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 2 deletions

View File

@ -893,9 +893,15 @@ define([
// Update recurrence rule. We may create a new event here
var dontSendUpdate = false;
if (typeof(changes.recurrenceRule) !== "undefined") {
if (['one','from'].includes(type.which) && !data.rawData.isOrigin) {
cleanAfter(type.when);
if (type.which === "all" && changes.recurrenceRule.until) {
// Remove changes after the last iteration
cleanAfter(changes.recurrenceRule.until);
}
else if (['one','from'].includes(type.which) && !data.rawData.isOrigin) {
// Start cleaning after the event (otherwise it resets the current event)
cleanAfter(type.when + 1);
} else {
// Else wipe everything
update = ev.recUpdate = RECUPDATE;
}
}