Merge pull request #1574 from cmgustavo/bug/backup-ios-email-solution

Fix backup for iOS using textarea
This commit is contained in:
Matias Alejo Garcia 2014-10-17 08:58:53 -03:00
commit 21a48bb4af
3 changed files with 13 additions and 7 deletions

View file

@ -17,11 +17,15 @@ BackupService.prototype.getBackup = function(wallet) {
return wallet.toEncryptedObj(); return wallet.toEncryptedObj();
}; };
BackupService.prototype.download = function(wallet) { BackupService.prototype.getFilename = function(wallet) {
var ew = this.getBackup(wallet);
var walletName = this.getName(wallet); var walletName = this.getName(wallet);
var copayerName = this.getCopayer(wallet); var copayerName = this.getCopayer(wallet);
var filename = (copayerName ? copayerName + '-' : '') + walletName + '-keybackup.json.aes'; return (copayerName ? copayerName + '-' : '') + walletName + '-keybackup.json.aes';
};
BackupService.prototype.download = function(wallet) {
var ew = this.getBackup(wallet);
var filename = this.getFilename(wallet);
this.notifications.success('Backup created', 'Encrypted backup file saved'); this.notifications.success('Backup created', 'Encrypted backup file saved');
var blob = new Blob([ew], { var blob = new Blob([ew], {

View file

@ -120,13 +120,14 @@
<span translate>yet to backup the wallet.</span> <span translate>yet to backup the wallet.</span>
</button> </button>
<div ng-show="backupPlainText"> <div ng-show="backupPlainText">
<textarea readonly rows="5">{{backupPlainText}}</textarea>
<div class="show-for-large-up"> <div class="show-for-large-up">
<textarea readonly rows="5">{{backupPlainText}}</textarea>
<span translate class="size-12">Copy to clipboard</span> <span class="btn-copy" clip-copy="backupPlainText"> </span> <span translate class="size-12">Copy to clipboard</span> <span class="btn-copy" clip-copy="backupPlainText"> </span>
</div> </div>
<div class="hide-for-large-up m10b"> <div class="hide-for-large-up m10b">
<span translate class="size-12">Copy this text as it is in a safe place (notepad or email)</span> <textarea rows="10">{{backupPlainText}}</textarea>
</div> </div>
<div translate class="m10v size-12 text-gray text-right">Copy this text as it is in a safe place (notepad or email)</div>
</div> </div>
<button class="button primary right m0" <button class="button primary right m0"
ng-show="hideViewBackup" ng-show="hideViewBackup"

View file

@ -10,13 +10,14 @@
<a translate class="button primary m0" ng-click="viewBackup()" <a translate class="button primary m0" ng-click="viewBackup()"
ng-show="isSafari && !hideViewBackup">View Backup</a> ng-show="isSafari && !hideViewBackup">View Backup</a>
<div ng-show="backupPlainText"> <div ng-show="backupPlainText">
<textarea readonly rows="5">{{backupPlainText}}</textarea>
<div class="show-for-large-up"> <div class="show-for-large-up">
<textarea readonly rows="5">{{backupPlainText}}</textarea>
<span translate class="size-12">Copy to clipboard</span> <span class="btn-copy" clip-copy="backupPlainText"> </span> <span translate class="size-12">Copy to clipboard</span> <span class="btn-copy" clip-copy="backupPlainText"> </span>
</div> </div>
<div class="hide-for-large-up"> <div class="hide-for-large-up">
<span translate class="size-12">Copy this text as it is in a safe place (notepad or email)</span> <textarea rows="10">{{backupPlainText}}</textarea>
</div> </div>
<div translate class="m10t size-12 text-gray text-right">Copy this text as it is in a safe place (notepad or email)</div>
</div> </div>
</div> </div>
<div class="large-12 columns line-dashed-h m15b"></div> <div class="large-12 columns line-dashed-h m15b"></div>