notify when email was re-send

This commit is contained in:
Gustavo Maximiliano Cortez 2014-12-19 16:05:52 -03:00
parent ef8fb60812
commit 188a0d348c
2 changed files with 18 additions and 7 deletions

View File

@ -51,7 +51,12 @@
<span class="status" ng-if="$root.needsEmailConfirmation && !$root.pleaseConfirmEmailAck">
<a class="close-notification text-white" ng-click="$root.pleaseConfirmEmailAck=true">&#215;</a>
<a class="text-white button warning tiny m0 right" ng-click="resendVerificationEmail()">Resend</a>
<button class="text-white warning tiny m0 right"
ng-click="resendVerificationEmail()"
ng-disabled="loading"
ng-show="!hideReSendButton">
{{ loading ? 'Resending...' : 'Resend' }}
</button>
<i class="fi-alert size-36 left m20r"></i>
<span translate>
<strong class="size-16">Email not confirmed</strong>.<br>

View File

@ -1,19 +1,25 @@
'use strict';
angular.module('copayApp.controllers').controller('IndexController', function($scope, go, isCordova, identityService, notification) {
angular.module('copayApp.controllers').controller('IndexController', function($scope, $timeout, go, isCordova, identityService, notification) {
$scope.init = function() {
};
$scope.resendVerificationEmail = function() {
$scope.loading = true;
identityService.resendVerificationEmail(function(err) {
if (err) {
notification.error('Could not send email', 'There was a problem sending the verification email.');
setTimeout(function() {
$scope.$digest();
}, 1);
return;
notification.error('Could not send email', 'There was a problem sending the verification email.');
}
else {
notification.success('Email sent', 'Check your inbox and confirms the email');
$scope.hideReSendButton = true;
}
$scope.loading = null;
$timeout(function() {
$scope.$digest();
}, 1);
return;
});
};