Prevent adding a calendar with a name already used
This commit is contained in:
parent
c7ea5a7463
commit
97781c22c8
1 changed files with 6 additions and 0 deletions
|
@ -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
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue