settings: show wallet network on sidebar
This commit is contained in:
parent
76f3b1c321
commit
4cfe87490f
4 changed files with 5 additions and 7 deletions
|
|
@ -37,7 +37,6 @@ angular.module('copayApp.controllers').controller('OpenController', function($sc
|
||||||
try {
|
try {
|
||||||
w = walletFactory.open($scope.selectedWalletId, passphrase);
|
w = walletFactory.open($scope.selectedWalletId, passphrase);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
throw e;
|
|
||||||
errMsg = e.message;
|
errMsg = e.message;
|
||||||
};
|
};
|
||||||
if (!w) {
|
if (!w) {
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,11 @@
|
||||||
angular.module('copayApp.controllers').controller('VersionController',
|
angular.module('copayApp.controllers').controller('VersionController',
|
||||||
function($scope, $rootScope, $http, notification) {
|
function($scope, $rootScope, $http, notification) {
|
||||||
|
|
||||||
|
var w = $rootScope.wallet;
|
||||||
|
|
||||||
$scope.version = copay.version;
|
$scope.version = copay.version;
|
||||||
$scope.commitHash = copay.commitHash;
|
$scope.commitHash = copay.commitHash;
|
||||||
$scope.networkName = config.networkName;
|
$scope.networkName = w ? w.getNetworkName() : '';
|
||||||
$scope.defaultLanguage = config.defaultLanguage;
|
$scope.defaultLanguage = config.defaultLanguage;
|
||||||
if (_.isUndefined($rootScope.checkVersion))
|
if (_.isUndefined($rootScope.checkVersion))
|
||||||
$rootScope.checkVersion = true;
|
$rootScope.checkVersion = true;
|
||||||
|
|
@ -30,4 +32,4 @@ angular.module('copayApp.controllers').controller('VersionController',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,6 @@ WalletFactory.prototype._checkRead = function(walletId) {
|
||||||
* @return {string} network name
|
* @return {string} network name
|
||||||
*/
|
*/
|
||||||
WalletFactory.prototype.obtainNetworkName = function(obj) {
|
WalletFactory.prototype.obtainNetworkName = function(obj) {
|
||||||
console.log(JSON.stringify(obj));
|
|
||||||
return obj.networkName ||
|
return obj.networkName ||
|
||||||
obj.opts.networkName ||
|
obj.opts.networkName ||
|
||||||
obj.publicKeyRing.networkName ||
|
obj.publicKeyRing.networkName ||
|
||||||
|
|
@ -107,8 +106,6 @@ WalletFactory.prototype.fromObj = function(obj, skipFields) {
|
||||||
throw new Error('unknown field:' + k);
|
throw new Error('unknown field:' + k);
|
||||||
});
|
});
|
||||||
|
|
||||||
alert(networkName);
|
|
||||||
|
|
||||||
var w = Wallet.fromObj(obj, this.storage, this.networks[networkName], this.blockchains[networkName]);
|
var w = Wallet.fromObj(obj, this.storage, this.networks[networkName], this.blockchains[networkName]);
|
||||||
if (!w) return false;
|
if (!w) return false;
|
||||||
this._checkVersion(w.version);
|
this._checkVersion(w.version);
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<div ng-controller="VersionController">
|
<div ng-controller="VersionController">
|
||||||
<small>v{{version}} ({{defaultLanguage}})</small>
|
<small>v{{version}} ({{defaultLanguage}})</small>
|
||||||
<small>#{{commitHash}}</small>
|
<small>#{{commitHash}}</small>
|
||||||
<small ng-if="networkName=='testnet'">[ {{networkName}} ]</small>
|
<small ng-if="networkName ==='testnet' || networkName ==='livenet'">[ {{networkName}} ]</small>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue