mirror of https://github.com/BTCPrivate/copay.git
Remove email backup feature
This commit is contained in:
parent
670560ea41
commit
7847bdcb2c
19
index.html
19
index.html
|
@ -720,26 +720,11 @@
|
|||
<p> Download File </p>
|
||||
</a>
|
||||
</div>
|
||||
<div class="large-6 medium-6 columns">
|
||||
<a class="panel radius box-backup" ng-click="openModal()">
|
||||
<i class="fi-mail size-72"></i>
|
||||
<p> Backup to email </p>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row text-center small" style="margin-top:20px">
|
||||
<div class="row text-center small" style="margin-top:70px">
|
||||
<div class="button radius warning" ng-really-message="Are you sure to delete this wallet from this computer?" ng-really-click="deleteWallet()">Delete this wallet from this computer</div>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/ng-template" id="backupModal.html">
|
||||
<h3>Insert your email</h3>
|
||||
<form name="emailForm" ng-submit="submit(emailForm)">
|
||||
<p><input type="email" ng-model="$parent.email" placeholder="your@email.com" required/></p>
|
||||
<input type="submit" class="button" value="Send" ng-disabled="emailForm.$invalid"/>
|
||||
</form>
|
||||
<a class="close-reveal-modal" ng-click="cancel()">×</a>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<!-- CONFIG -->
|
||||
|
|
|
@ -8,17 +8,6 @@ angular.module('copayApp.controllers').controller('BackupController',
|
|||
backupService.download($rootScope.wallet);
|
||||
};
|
||||
|
||||
$scope.openModal = function() {
|
||||
var modalInstance = $modal.open({
|
||||
templateUrl: 'backupModal.html',
|
||||
controller: ModalInstanceCtrl,
|
||||
});
|
||||
|
||||
modalInstance.result.then(function(email) {
|
||||
backupService.sendEmail(email, $rootScope.wallet);
|
||||
});
|
||||
};
|
||||
|
||||
$scope.deleteWallet = function() {
|
||||
var w = $rootScope.wallet;
|
||||
w.disconnect();
|
||||
|
@ -28,14 +17,3 @@ angular.module('copayApp.controllers').controller('BackupController',
|
|||
};
|
||||
|
||||
});
|
||||
|
||||
var ModalInstanceCtrl = function($scope, $modalInstance) {
|
||||
|
||||
$scope.submit = function(form) {
|
||||
$modalInstance.close($scope.email);
|
||||
};
|
||||
|
||||
$scope.cancel = function() {
|
||||
$modalInstance.dismiss('cancel');
|
||||
};
|
||||
};
|
||||
|
|
|
@ -29,22 +29,4 @@ BackupService.prototype.download = function(wallet) {
|
|||
saveAs(blob, filename);
|
||||
};
|
||||
|
||||
BackupService.prototype.sendEmail = function(email, wallet) {
|
||||
var ew = wallet.toEncryptedObj();
|
||||
var body = ew;
|
||||
var subject = this.getName(wallet);
|
||||
var href = 'mailto:' + email + '?' + 'subject=[Copay Backup] ' + subject + '&' + 'body=' + body;
|
||||
|
||||
if (window.cshell) {
|
||||
return window.cshell.send('backup:email', href);
|
||||
}
|
||||
|
||||
var newWin = window.open(href, '_blank', 'scrollbars=yes,resizable=yes,width=10,height=10');
|
||||
if (newWin) {
|
||||
setTimeout(function() {
|
||||
newWin.close();
|
||||
}, 1000);
|
||||
}
|
||||
};
|
||||
|
||||
angular.module('copayApp.services').service('backupService', BackupService);
|
||||
|
|
|
@ -100,10 +100,4 @@ describe("Unit: Backup Service", function() {
|
|||
backupService.download(new FakeWallet());
|
||||
expectation.once();
|
||||
}));
|
||||
it('should backup by email', inject(function(backupService) {
|
||||
var mock = sinon.mock(window);
|
||||
var expectation = mock.expects('open');
|
||||
backupService.sendEmail('fake@test.com', new FakeWallet());
|
||||
expectation.once();
|
||||
}));
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue