From a1d7f4b8b39994f56c26b8fdc15e2685f8da0c06 Mon Sep 17 00:00:00 2001
From: blavenie <benoit.lavenier@e-is.pro>
Date: Mon, 21 Aug 2017 19:11:55 +0200
Subject: [PATCH] [fix] fix add picture using device camera (avoid error
 message)

---
 www/plugins/es/js/controllers/common-controllers.js   | 1 -
 www/plugins/es/js/controllers/group-controllers.js    | 1 -
 www/plugins/es/js/controllers/registry-controllers.js | 1 -
 3 files changed, 3 deletions(-)

diff --git a/www/plugins/es/js/controllers/common-controllers.js b/www/plugins/es/js/controllers/common-controllers.js
index 0dd165c00..a6af511a0 100644
--- a/www/plugins/es/js/controllers/common-controllers.js
+++ b/www/plugins/es/js/controllers/common-controllers.js
@@ -37,7 +37,6 @@ function ESPicturesEditController($scope, UIUtils, $q, Device) {
           src: "data:image/png;base64," + imageData,
           isnew: true // use to prevent visibility hidden (if animation)
         });
-        $scope.$apply();
       })
       .catch(UIUtils.onError('ERROR.TAKE_PICTURE_FAILED'));
   };
diff --git a/www/plugins/es/js/controllers/group-controllers.js b/www/plugins/es/js/controllers/group-controllers.js
index 60cab476f..4d7c05a52 100644
--- a/www/plugins/es/js/controllers/group-controllers.js
+++ b/www/plugins/es/js/controllers/group-controllers.js
@@ -358,7 +358,6 @@ function ESGroupEditController($scope, esGroup, UIUtils, $state, $q, Device,
     Device.camera.getPicture()
       .then(function(imageData) {
         $scope.pictures.push({src: "data:image/png;base64," + imageData});
-        $scope.$apply();
       })
       .catch(UIUtils.onError('ERROR.TAKE_PICTURE_FAILED'));
   };
diff --git a/www/plugins/es/js/controllers/registry-controllers.js b/www/plugins/es/js/controllers/registry-controllers.js
index a33ceef00..b8be2f547 100644
--- a/www/plugins/es/js/controllers/registry-controllers.js
+++ b/www/plugins/es/js/controllers/registry-controllers.js
@@ -669,7 +669,6 @@ function ESRegistryRecordEditController($scope, esRegistry, UIUtils, $state, $q,
     Device.camera.getPicture()
     .then(function(imageData) {
       $scope.pictures.push({src: "data:image/png;base64," + imageData});
-      $scope.$apply();
     })
     .catch(UIUtils.onError('ERROR.TAKE_PICTURE_FAILED'));
   };
-- 
GitLab