migration tested
This commit is contained in:
parent
cf557fe018
commit
648d754556
3 changed files with 19 additions and 9 deletions
|
|
@ -38,6 +38,9 @@ angular
|
||||||
return v;
|
return v;
|
||||||
});
|
});
|
||||||
historicLog.add(level, args.join(' '));
|
historicLog.add(level, args.join(' '));
|
||||||
|
if (window.cordova)
|
||||||
|
console.log(args.join(' '));
|
||||||
|
|
||||||
orig.apply(null, args)
|
orig.apply(null, args)
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -285,7 +285,7 @@ angular.module('copayApp.services')
|
||||||
root._createNewProfile(function(err, p) {
|
root._createNewProfile(function(err, p) {
|
||||||
if (err) return cb(err);
|
if (err) return cb(err);
|
||||||
|
|
||||||
console.log('[profileService.js.287]'); //TODO
|
console.log('[profileService.js.287]'); //TODO
|
||||||
root.bindProfile(p, function(err) {
|
root.bindProfile(p, function(err) {
|
||||||
storageService.storeNewProfile(p, function(err) {
|
storageService.storeNewProfile(p, function(err) {
|
||||||
return cb(err);
|
return cb(err);
|
||||||
|
|
|
||||||
|
|
@ -52,21 +52,28 @@ angular.module('copayApp.services')
|
||||||
root.tryToMigrate = function(cb) {
|
root.tryToMigrate = function(cb) {
|
||||||
if (!isCordova) return cb();
|
if (!isCordova) return cb();
|
||||||
|
|
||||||
localStorageService.get('profile', function(err, p) {
|
localStorageService.get('profile', function(err, str) {
|
||||||
if (err) cb(err);
|
if (err) return cb(err);
|
||||||
if (!p) return cb();
|
if (!str) return cb();
|
||||||
|
|
||||||
$log.info('Starting Migration profile to File storage...')
|
$log.info('Starting Migration profile to File storage...')
|
||||||
fileStorageService.create('profile', p, function(err) {
|
|
||||||
|
fileStorageService.create('profile', str, function(err) {
|
||||||
if (err) cb(err);
|
if (err) cb(err);
|
||||||
$log.info('Profile Migrated successfully');
|
$log.info('Profile Migrated successfully');
|
||||||
|
|
||||||
localStorageService.get('config', function(err, c) {
|
localStorageService.get('config', function(err, c) {
|
||||||
if (err) cb(err);
|
if (err) return cb(err);
|
||||||
if (!c) return cb(null, p);
|
if (!c) return root.getProfile(cb);
|
||||||
|
|
||||||
fileStorageService.create('config', c, function(err) {
|
fileStorageService.create('config', c, function(err) {
|
||||||
if (err) cb(err);
|
|
||||||
|
if (err) {
|
||||||
|
$log.info('Error migrating config: ignoring', err);
|
||||||
|
return root.getProfile(cb);
|
||||||
|
}
|
||||||
$log.info('Config Migrated successfully');
|
$log.info('Config Migrated successfully');
|
||||||
return cb(null, p)
|
return root.getProfile(cb);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue