mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-18 06:34:53 +00:00
fix(calendar(js)): prevent duplicate event creation in case of an event conflict
In case of an calendar event conflict the form submit button was not disabled after use, allowing it to be clicked again. This could have resulted in a double creation of the submit event.
This commit is contained in:
@@ -547,10 +547,13 @@
|
||||
$mdDialog.cancel = vm.originalModalCancel;
|
||||
$mdDialog.hide();
|
||||
}, function(response) {
|
||||
if (response.status == CalendarSettings.ConflictHTTPErrorCode)
|
||||
vm.allowResubmit(form);
|
||||
|
||||
if (response.status == CalendarSettings.ConflictHTTPErrorCode) {
|
||||
vm.attendeeConflictError = _.isObject(response.data.message) ? response.data.message : { reject: response.data.message };
|
||||
else
|
||||
} else {
|
||||
vm.edit(form);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -584,6 +587,11 @@
|
||||
form.$setDirty();
|
||||
};
|
||||
|
||||
this.allowResubmit = function (form) {
|
||||
form.$setPristine();
|
||||
form.$setDirty();
|
||||
};
|
||||
|
||||
function getHours() {
|
||||
var hours = [];
|
||||
for (var i = 0; i <= 23; i++) {
|
||||
|
||||
Reference in New Issue
Block a user