From a388c5f4407fec9600dca76dbde25ba24dc31d5e Mon Sep 17 00:00:00 2001 From: dobavictor Date: Fri, 9 Jun 2017 14:31:50 +0200 Subject: [PATCH] Add catch to rejected promise. Silence exceptions of type "Possible unhandled rejection" (with angularjs 1.6) when the lightbox modal gets dismissed. --- dist/angular-bootstrap-lightbox.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/angular-bootstrap-lightbox.js b/dist/angular-bootstrap-lightbox.js index 3739278..b0a46ac 100644 --- a/dist/angular-bootstrap-lightbox.js +++ b/dist/angular-bootstrap-lightbox.js @@ -340,7 +340,7 @@ angular.module('bootstrapLightbox').provider('Lightbox', function () { }, modalParams || {})); // modal close handler - Lightbox.modalInstance.result['finally'](function () { + Lightbox.modalInstance.result.finally(function () { // prevent the lightbox from flickering from the old image when it gets // opened again Lightbox.images = []; @@ -355,7 +355,7 @@ angular.module('bootstrapLightbox').provider('Lightbox', function () { if (cfpLoadingBar) { cfpLoadingBar.complete(); } - }); + }).then(function() {}, function() {}); return Lightbox.modalInstance; };