From a50d93636a4d31d00d09cc4be59ac14115e1d3b2 Mon Sep 17 00:00:00 2001 From: blavenie <benoit.lavenier@e-is.pro> Date: Thu, 9 Nov 2017 11:12:01 +0100 Subject: [PATCH] [fix] fix i18n [fix] Transfer: avoid multiple send call [fix] Page search: missing Device in controller def [fix] Wot search: get more at a distance of 20% --- www/i18n/locale-es-ES.json | 2 +- www/js/controllers/transfer-controllers.js | 20 +++++++++++++------ .../es/js/controllers/registry-controllers.js | 8 ++++---- .../es/js/services/profile-services.js | 3 ++- www/templates/wot/lookup_form.html | 2 +- 5 files changed, 22 insertions(+), 13 deletions(-) diff --git a/www/i18n/locale-es-ES.json b/www/i18n/locale-es-ES.json index c894e5a7b..d88710ccd 100644 --- a/www/i18n/locale-es-ES.json +++ b/www/i18n/locale-es-ES.json @@ -514,7 +514,7 @@ "COMMENT": "Comentario", "COMMENT_HELP": "Comentario", "BTN_SEND": "Mandar", - "BTN_ADD_COMMENT": "Añadir un comentario",, + "BTN_ADD_COMMENT": "Añadir un comentario", "WARN_COMMENT_IS_PUBLIC": "Tenga en cuenta que los <b>comentarios son públicos</b> (sin encriptar).", "MODAL": { "TITLE": "Transferencia" diff --git a/www/js/controllers/transfer-controllers.js b/www/js/controllers/transfer-controllers.js index c8faeaefb..5419f1242 100644 --- a/www/js/controllers/transfer-controllers.js +++ b/www/js/controllers/transfer-controllers.js @@ -232,6 +232,10 @@ function TransferModalController($scope, $q, $translate, $timeout, $filter, $foc delete $scope.form.amount.$error.min; } + // Avoid multiple call + if ($scope.sending) return; + $scope.sending = true; + var currentUD; return $q.all([ // Make sure user is auth @@ -244,11 +248,14 @@ function TransferModalController($scope, $q, $translate, $timeout, $filter, $foc }), // Hide digit keyboard - $scope.hideDigitKeyboard(0) + $scope.hideDigitKeyboard(300) ]) .then($scope.askTransferConfirm) .then(function(confirm){ - if (!confirm) return; + if (!confirm) { + $scope.sending = false; + return; + } return UIUtils.loading.show() .then(function(){ @@ -269,8 +276,8 @@ function TransferModalController($scope, $q, $translate, $timeout, $filter, $foc return csWallet.transfer($scope.formData.destPub, amount, comment, $scope.formData.useRelative); }) .then(function() { + $scope.sending = false; UIUtils.loading.hide(); - return $scope.closeModal(true); }) .then(function(res) { @@ -279,7 +286,10 @@ function TransferModalController($scope, $q, $translate, $timeout, $filter, $foc }, 500); return res; }) - .catch(UIUtils.onError('ERROR.SEND_TX_FAILED')); + .catch(function(err) { + $scope.sending = false; + UIUtils.onError('ERROR.SEND_TX_FAILED')(err); + }); }); }; @@ -348,8 +358,6 @@ function TransferModalController($scope, $q, $translate, $timeout, $filter, $foc // Device enable: hide OS keyboard if (Device.enable) { - console.log(_.keys(Device.keyboard)); - // Hide device keyboard Device.keyboard.close(); diff --git a/www/plugins/es/js/controllers/registry-controllers.js b/www/plugins/es/js/controllers/registry-controllers.js index ebfa40d35..9bd124a5d 100644 --- a/www/plugins/es/js/controllers/registry-controllers.js +++ b/www/plugins/es/js/controllers/registry-controllers.js @@ -109,7 +109,7 @@ angular.module('cesium.es.registry.controllers', ['cesium.es.services', 'cesium. ; function ESRegistryLookupController($scope, $focus, $timeout, $filter, $controller, $location, $state, $translate, $ionicPopover, - UIUtils, ModalUtils, BMA, csSettings, csWallet, esModals, esRegistry, esHttp) { + Device, UIUtils, ModalUtils, BMA, csSettings, csWallet, esModals, esRegistry, esHttp) { 'ngInject'; // Initialize the super class and extend it. @@ -1261,13 +1261,13 @@ function ESRegistryRecordEditController($scope, $timeout, $state, $q, $ionicHis $scope.openPicturePopup = function() { Device.camera.getPicture() .then(function(imageData) { - $scope.pictures.push({src: "data:image/png;base64," + imageData}); + if (imageData) { + $scope.pictures.push({src: "data:image/png;base64," + imageData}); + } }) .catch(UIUtils.onError('ERROR.TAKE_PICTURE_FAILED')); }; - - $scope.rotateAvatar = function(){ if (!$scope.avatar || !$scope.avatar.src || $scope.rotating) return; diff --git a/www/plugins/es/js/services/profile-services.js b/www/plugins/es/js/services/profile-services.js index a58ee677e..ab9ce3cfa 100644 --- a/www/plugins/es/js/services/profile-services.js +++ b/www/plugins/es/js/services/profile-services.js @@ -91,9 +91,10 @@ angular.module('cesium.es.profile.services', ['cesium.services', 'cesium.es.http // decrypt socials (if login) return SocialUtils.open(profile.source.socials, pubkey) .then(function(){ - //console.log(profile.source.socials); // Exclude invalid decrypted socials + //console.debug(profile.source.socials); //profile.source.socials = _.where(profile.source.socials, {valid: true}); + return profile; }); } diff --git a/www/templates/wot/lookup_form.html b/www/templates/wot/lookup_form.html index 1e436e298..98083bbd6 100644 --- a/www/templates/wot/lookup_form.html +++ b/www/templates/wot/lookup_form.html @@ -174,7 +174,7 @@ ng-if="search.hasMore" spinner="android" on-infinite="showMore()" - distance="2%"> + distance="20%"> </ion-infinite-scroll> </ng-if> -- GitLab