diff --git a/www/plugins/es/js/controllers/like-controllers.js b/www/plugins/es/js/controllers/like-controllers.js index 2982ce9f7c614c2bd2308cccf2e7006137b62619..eca68ff8931c474fb553b866dbaa4050a3a1ab63 100644 --- a/www/plugins/es/js/controllers/like-controllers.js +++ b/www/plugins/es/js/controllers/like-controllers.js @@ -115,9 +115,11 @@ function ESLikesController($scope, $q, $timeout, $translate, $ionicPopup, UIUtil // Make sure tobe auth before continue if (!csWallet.isLogin()) { return csWallet.auth({minData: true}) - .then(function(){ + .then(function(data){ UIUtils.loading.hide(); - return $scope.reportAbuse(event, options); // loop + if (!data) throw new Error('CANCELLED'); + options.pubkey = options.pubkey ||Â data.pubkey; + return $scope.toggleLike(event, options); // loop }); } @@ -141,9 +143,9 @@ function ESLikesController($scope, $q, $timeout, $translate, $ionicPopup, UIUtil else { return Modals.showSelectWallet({displayBalance: false}) .then(function (wallet) { - if (!wallet) throw 'CANCELLED'; + if (!wallet) throw new Error('CANCELLED'); options.pubkey = wallet.data.pubkey; - return $scope.reportAbuse(event, options); // Loop + return $scope.toggleLike(event, options); // Loop }); } } @@ -243,8 +245,10 @@ function ESLikesController($scope, $q, $timeout, $translate, $ionicPopup, UIUtil // Make sure tobe auth before continue if (!csWallet.isLogin()) { return csWallet.auth({minData: true}) - .then(function(){ + .then(function(data){ UIUtils.loading.hide(); + if (!data) throw new Error('CANCELLED'); + options.pubkey = options.pubkey ||Â data.pubkey; return $scope.reportAbuse(event, options); // loop }); }