add notification saying backup was created

This commit is contained in:
Manuel Araoz 2014-06-17 11:33:43 -03:00
parent 9e79e58c35
commit 718ae69576
2 changed files with 9 additions and 4 deletions

View File

@ -1,6 +1,8 @@
'use strict';
var BackupService = function() {};
var BackupService = function($notification) {
this.notifications = $notification;
};
BackupService.prototype.getName = function(wallet) {
return (wallet.name ? (wallet.name+'-') : '') + wallet.id;
@ -11,6 +13,7 @@ BackupService.prototype.download = function(wallet) {
var timestamp = +(new Date());
var walletName = this.getName(wallet);
var filename = walletName + '-' + timestamp + '-keybackup.json.aes';
this.notifications.success('Backup created', 'Encrypted backup file saved.');
var blob = new Blob([ew], {
type: 'text/plain;charset=utf-8'
});
@ -44,4 +47,4 @@ BackupService.prototype.sendEmail = function(email, wallet) {
}
};
angular.module('copayApp.services').value('backupService', new BackupService());
angular.module('copayApp.services').service('backupService', BackupService);

View File

@ -1,7 +1,7 @@
'use strict';
angular.module('notifications', []).
factory('$notification', ['$timeout',function($timeout){
factory('$notification', ['$timeout',function($timeout, $rootScope){
var notifications = JSON.parse(localStorage.getItem('$notifications')) || [],
queue = [];
@ -197,7 +197,9 @@ angular.module('notifications', []).
clear: function(){
notifications = [];
this.save();
}
},
init: function() {}
};
}]).