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

[fix] Try a fix for issue #742

parent 12677cf3
No related branches found
No related tags found
No related merge requests found
......@@ -224,10 +224,14 @@ function WalletController($scope, $rootScope, $q, $ionicPopup, $timeout, $state,
})
.catch(function(err) {
if (err == 'CANCELLED') throw err;
if (err && err.ucode != BMA.errorCodes.MEMBERSHIP_ALREADY_SEND) return;
if (err && err.ucode != BMA.errorCodes.MEMBERSHIP_ALREADY_SEND) {
console.error("[wallet] Node: already membership", err);
UIUtils.loading.hide();
return; // OK
}
if (!retryCount || retryCount <= 2) {
return $timeout(function() {
$scope.doMembershipIn(retryCount ? retryCount+1 : 1);
return $scope.doMembershipIn((retryCount||0) + 1);
}, 1000);
}
throw err;
......@@ -337,16 +341,22 @@ function WalletController($scope, $rootScope, $q, $ionicPopup, $timeout, $state,
*/
$scope.renewMembership = function(confirm) {
// Make sure user is (or was) a member
if (!wallet.isMember() && !$scope.formData.requirements.wasMember) {
return UIUtils.alert.error("ERROR.ONLY_MEMBER_CAN_EXECUTE_THIS_ACTION");
}
// If renew is not need, ask confirmation
if (!confirm && !$scope.formData.requirements.needRenew) {
return $translate("CONFIRM.NOT_NEED_RENEW_MEMBERSHIP", {membershipExpiresIn: $scope.formData.requirements.membershipExpiresIn})
.then(function(message) {
return UIUtils.alert.confirm(message);
})
.then(function(confirm) {
if (confirm) $scope.renewMembership(true); // loop with confirm
if (confirm) {
// loop with confirm
return $scope.renewMembership(true);
}
});
}
......
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