From 2c86f68fb9b790b9fea22350cc56e395412b93e9 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Thu, 23 Nov 2017 16:44:50 -0500 Subject: [PATCH] (js) Catch some exceptions to avoid console errors --- .../js/Scheduler/CalendarListController.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/UI/WebServerResources/js/Scheduler/CalendarListController.js b/UI/WebServerResources/js/Scheduler/CalendarListController.js index 455fa07a9..c4a73b263 100644 --- a/UI/WebServerResources/js/Scheduler/CalendarListController.js +++ b/UI/WebServerResources/js/Scheduler/CalendarListController.js @@ -217,11 +217,13 @@ if (component.isAllDay) coordinates.duration -= 96; component.setDelta(coordinates.duration * 15); - newComponent(null, 'appointment', component).finally(function() { - $timeout(function() { - Component.$resetGhost(); + newComponent(null, 'appointment', component) + .catch() + .finally(function() { + $timeout(function() { + Component.$resetGhost(); + }); }); - }); } else { delta = pointerHandler.currentEventCoordinates.getDelta(pointerHandler.originalEventCoordinates); @@ -272,6 +274,8 @@ controller: RecurrentComponentDialogController }).then(function() { $rootScope.$emit('calendars:list'); + }, function() { + // Cancel }).finally(function() { $timeout(function() { Component.$resetGhost(); @@ -289,6 +293,8 @@ component.$adjust(params).then($mdDialog.hide, function(response) { $mdDialog.cancel().then(function() { onComponentAdjustError(response, component, params); + }, function() { + // Cancel }); }); }; @@ -297,6 +303,8 @@ component.$adjust(params).then($mdDialog.hide, function(response) { $mdDialog.cancel().then(function() { onComponentAdjustError(response, component, params); + }, function() { + // Cancel }); }); }; @@ -319,6 +327,8 @@ } }).then(function() { $rootScope.$emit('calendars:list'); + }, function() { + // Cancel }); } }