diff --git a/js/controllers/home.js b/js/controllers/home.js index 4458de5b5..a1032e5fa 100644 --- a/js/controllers/home.js +++ b/js/controllers/home.js @@ -18,6 +18,7 @@ angular.module('copayApp.controllers').controller('HomeController', function($sc $scope.done = function() { $rootScope.starting = false; + $rootScope.$digest(); }; @@ -46,7 +47,7 @@ angular.module('copayApp.controllers').controller('HomeController', function($sc } else { $scope.error = 'Unknown error'; } - $scope.done(); + return $scope.done(); } if (iden) { diff --git a/js/models/Identity.js b/js/models/Identity.js index 1717204c6..2fb96c0a6 100644 --- a/js/models/Identity.js +++ b/js/models/Identity.js @@ -122,7 +122,7 @@ Identity.open = function(opts, cb) { var storage = opts.storage || opts.pluginManager.get('DB'); storage.setCredentials(opts.email, opts.password, opts); - storage.getItem(Identity.getKeyForEmail(opts.email), function(err, data) { + storage.getItem(Identity.getKeyForEmail(opts.email), function(err, data, headers) { var exported; if (err) { return cb(err); @@ -132,7 +132,7 @@ Identity.open = function(opts, cb) { } catch (e) { return cb(e); } - return cb(null, new Identity(_.extend(opts, exported))); + return cb(null, new Identity(_.extend(opts, exported)), headers); }); }; diff --git a/js/plugins/EncryptedInsightStorage.js b/js/plugins/EncryptedInsightStorage.js index 622c92678..0081dc0e3 100644 --- a/js/plugins/EncryptedInsightStorage.js +++ b/js/plugins/EncryptedInsightStorage.js @@ -20,7 +20,7 @@ EncryptedInsightStorage.prototype._brokenDecrypt = function(body) { EncryptedInsightStorage.prototype.getItem = function(name, callback) { var self = this; InsightStorage.prototype.getItem.apply(this, [name, - function(err, body) { + function(err, body, headers) { if (err) { return callback(err); } @@ -35,7 +35,7 @@ EncryptedInsightStorage.prototype.getItem = function(name, callback) { log.debug('Could not decrypt value.'); return callback('PNOTFOUND'); } - return callback(null, decryptedJson); + return callback(null, decryptedJson, headers); } ]); }; diff --git a/js/plugins/InsightStorage.js b/js/plugins/InsightStorage.js index 8eea6cadf..d27b228f0 100644 --- a/js/plugins/InsightStorage.js +++ b/js/plugins/InsightStorage.js @@ -46,12 +46,12 @@ InsightStorage.prototype.getItem = function(name, callback) { var passphrase = this.getPassphrase(); var self = this; - this._makeGetRequest(passphrase, name, function(err, body) { + this._makeGetRequest(passphrase, name, function(err, body, headers) { if (err) log.warn(err); if (err && err.indexOf('PNOTFOUND') !== -1 && mayBeOldPassword(self.password)) { return self._brokenGetItem(name, callback); } - return callback(err, body); + return callback(err, body, headers); }); }; @@ -87,7 +87,6 @@ InsightStorage.prototype._makeGetRequest = function(passphrase, key, callback) { }; this.request.get(getParams, function(err, response, body) { -console.log('[InsightStorage.js.89:response:]',response); //TODO if (err) { return callback('Connection error'); } @@ -97,7 +96,7 @@ console.log('[InsightStorage.js.89:response:]',response); //TODO if (response.statusCode !== 200) { return callback('Connection error'); } - return callback(null, body); + return callback(null, body, response.getAllResponseHeaders()); } ); }; diff --git a/js/services/identityService.js b/js/services/identityService.js index 0fab2fe65..ac628a777 100644 --- a/js/services/identityService.js +++ b/js/services/identityService.js @@ -79,7 +79,7 @@ angular.module('copayApp.services') passphraseConfig: config.passphraseConfig, }; - copay.Identity.open(opts, function(err, iden) { + copay.Identity.open(opts, function(err, iden, headers) { if (err) return cb(err); root.bind(iden); return cb(null, iden);