Prevent adding a calendar with a name already used

This commit is contained in:
Raimund Schlüßler 2018-11-02 10:15:49 +01:00
parent c7ea5a7463
commit 97781c22c8
No known key found for this signature in database
GPG key ID: 036FA7EB1A599178

View file

@ -284,10 +284,16 @@ export default {
this.creating = false
},
create: function() {
if (!this.isNameAllowed(this.newCalendarName, 'new').allowed) {
return
}
this.appendCalendar({displayName: this.newCalendarName, color: this.selectedColor})
this.creating = false
},
save: function(calendar) {
if (!this.isNameAllowed(this.newCalendarName, calendar.id).allowed) {
return
}
this.changeCalendar({ calendar: calendar, newName: this.newCalendarName, newColor: this.selectedColor })
this.editing = false
},