Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 88645fdd authored by max65482's avatar max65482 Committed by Richard Steinmetz
Browse files

move fix to method changeDescription

parent 6df7166b
Loading
Loading
Loading
Loading
+8 −12
Original line number Diff line number Diff line
@@ -311,6 +311,14 @@ const mutations = {
	 * @param {string} data.description New description to set
	 */
	changeDescription(state, { calendarObjectInstance, description }) {
		// ALTREP parameter is not set by NC calendar, but by CalDAV clients like Thunderbird.
		// To avoid inconsistencies, remove ALTREP parameter upon modification.
		const descriptionProperty = calendarObjectInstance.eventComponent.getFirstProperty('Description')
		if (descriptionProperty) {
			if (descriptionProperty.hasParameter('ALTREP')) {
				descriptionProperty.deleteParameter('ALTREP')
			}
		}
		calendarObjectInstance.eventComponent.description = description
		calendarObjectInstance.description = description
	},
@@ -1518,18 +1526,6 @@ const actions = {
		const calendarObject = state.calendarObject

		if (eventComponent.isDirty()) {
			// ALTREP parameter is not set by NC calendar, but by CalDAV clients like Thunderbird.
			// To avoid inconsistencies, remove ALTREP parameter upon modification.
			const veventComponent = calendarObject.calendarComponent.getFirstComponent('VEVENT')
			if (veventComponent) {
				const descriptionProperty = veventComponent.getFirstProperty('Description')
				if (descriptionProperty) {
					if (descriptionProperty.hasParameter('ALTREP')) {
						descriptionProperty.deleteParameter('ALTREP')
					}
				}
			}

			const isForkedItem = eventComponent.primaryItem !== null
			let original = null
			let fork = null