added notification for wallet storage error

This commit is contained in:
Ivan Socolsky 2014-12-04 15:55:50 -03:00
parent b6583c7405
commit af721f697e
2 changed files with 10 additions and 0 deletions

View File

@ -248,6 +248,12 @@ Identity.prototype.storeWallet = function(wallet, cb) {
if (err) {
log.error('Wallet:' + wallet.getName() + ' couldnt be stored:', err);
log.error('Wallet:' + wallet.getName() + ' Size:', JSON.stringify(wallet.sizes()));
if (err.match('OVERQUOTA')) {
self.emitAndKeepAlive('walletStorageError', w.getId(), 'Storage limits on remote server exceeded');
} else {
self.emitAndKeepAlive('walletStorageError', w.getId(), err);
}
}
if (cb)
return cb(err);

View File

@ -307,6 +307,10 @@ angular.module('copayApp.services')
// do nothing. this is handled 'on sync' on controller.
});
iden.on('walletStorageError', function (wid, message) {
notification.error('Error storing wallet', message);
});
iden.on('closed', function() {
delete $rootScope['wallet'];
delete $rootScope['iden'];