Skip to content
Snippets Groups Projects
Commit d59c822b authored by Benoit Lavenier's avatar Benoit Lavenier
Browse files

[fix] Unable to like a profile or page (always open the report abuse)

parent 855f36a1
No related branches found
No related tags found
No related merge requests found
......@@ -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
});
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment