Skip to content

Commit

Permalink
linagora#611: Refactor function names
Browse files Browse the repository at this point in the history
  • Loading branch information
renaudboyer committed Mar 25, 2022
1 parent f463bdc commit d71d71d
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ function CalEventFormController(

$scope.editedEvent.attendees = getUpdatedAttendees();

if (!calEventUtils.hasAnyChange($scope.editedEvent, $scope.event) && !_calendarHasChanged()) {
if (!calEventUtils.hasAnyChange($scope.editedEvent, $scope.event) && !_eventCalendarHasChanged()) {
_hideModal();

return;
Expand Down Expand Up @@ -417,7 +417,7 @@ function CalEventFormController(
{ graceperiod: true, notifyFullcalendar: $state.is('calendar.main') }
);
})
.then(canPerformCalendarMove)
.then(canPerformEventMove)
.then(onEventCreateUpdateResponse)
.finally(function() {
$scope.restActive = false;
Expand Down Expand Up @@ -692,18 +692,18 @@ function CalEventFormController(
*
* @returns {Promise}
*/
function canPerformCalendarMove(success) {
function canPerformEventMove(success) {
if (!success || !$scope.canMoveEvent) return $q.when(false);

return _calendarHasChanged() ? changeCalendar() : $q.when();
return _eventCalendarHasChanged() ? moveEvent() : $q.when();
}

/**
* moves the event to the new calendar
*
* @returns {Promise} - resolves to true if the event calendar has changed
*/
function changeCalendar() {
function moveEvent() {
const destinationPath = calPathBuilder.forEventId($scope.calendarHomeId, _getCalendarByUniqueId($scope.selectedCalendar.uniqueId).id, $scope.editedEvent.uid);
const sourcePath = $scope.event.path;

Expand All @@ -715,7 +715,7 @@ function CalEventFormController(
*
* @returns {Boolean} - true if the event calendar and the selected calendar are different
*/
function _calendarHasChanged() {
function _eventCalendarHasChanged() {
return _getCalendarByUniqueId($scope.selectedCalendar.uniqueId).id !== $scope.editedEvent.calendarId;
}
}

0 comments on commit d71d71d

Please sign in to comment.