Colored-Coins / colored-coins-copay-wallet

Copay wallet with support for Colored Coins
MIT License
16 stars 19 forks source link

QRCode scan in asset transfert doesn't bring back data #9

Open antonio-fr opened 7 years ago

antonio-fr commented 7 years ago

The "modal" QRcode scanner is not giving out data when transferring asset. The other QRscan are working properly, but this one in the cc addon doesn't fill in data. When it reads a QRcode, the document page is back to the transfer page, doing nothing.

I tried to fix it doing the same as the paperwallet QR scan, but this doesn't work. I can't really figure out the issue. It is like the onQrCodeScanned(data) function is not properly registered.

--- a/public/views/coloredcoins/modals/send.html
+++ b/public/views/coloredcoins/modals/send.html
@@ -8,7 +8,7 @@
     </div>
     <h1 class="title ellipsis" translate>Send Asset</h1>
     <div class="right-small">
-      <qr-scanner on-scan="onQrCodeScanned(data)" />
+      <qr-scanner on-scan="onQrCodeScanned(data, assetTransferForm)" />
     </div>
   </ion-header-bar>
--- a/src/js/coloredcoins/controllers/modals/transfer.js
+++ b/src/js/coloredcoins/controllers/modals/transfer.js
@@ -9,9 +9,8 @@ var AssetTransferController = function ($rootScope, $scope, $tim...

   var self = this;

-  $scope.onQrCodeScanned = function (data) {
+  $scope.onQrCodeScanned = function (data, form) {
     this.error = '';
-    var form = this.assetTransferForm;
     if (data) {
       form.address.$setViewValue(new bitcore.URI(data).address.toString());
       form.address.$isValid = true;
antonio-fr commented 6 years ago

So, any thought tip, update or fix regarding this issue?

troggy commented 6 years ago

My webcam is broken at the moment, so I cannot test this. Once I find a working external one or another machine, I will take a look