Update external hardware preferences view.

This commit is contained in:
Gabrielbazan7 2017-03-21 11:28:43 -04:00 committed by Andy Phillipson
parent 80f3b70784
commit 7acd2331f7
3 changed files with 30 additions and 12 deletions

View File

@ -2,11 +2,14 @@
angular.module('copayApp.controllers').controller('preferencesExternalController', function($scope, $stateParams, lodash, gettextCatalog, popupService, profileService, walletService) {
var wallet = profileService.getWallet($stateParams.walletId);
$scope.wallet = wallet;
$scope.externalSource = lodash.find(walletService.externalSource, function(source) {
return source.id == wallet.getPrivKeyExternalSourceName();
});
$scope.hardwareConnected = $scope.externalSource.version.length > 0;
$scope.showMneumonicFromHardwarePopup = function() {
var title = gettextCatalog.getString('Warning!');
var message = gettextCatalog.getString('Are you being watched? Anyone with your recovery phrase can access or spend your bitcoin.');

View File

@ -3,6 +3,13 @@
.icon-bitpay {
background-image: url("../img/icon-bitpay.svg");
}
.warning {
color: $v-warning-color;
}
.centered {
width: 100%;
text-align: center;
}
.disabled {
color: $v-light-gray;
}

View File

@ -1,23 +1,31 @@
<ion-view>
<ion-view class="settings">
<ion-nav-bar class="bar-royal">
<ion-nav-title>{{externalSource.longName}}</ion-nav-title>
<ion-nav-back-button>
</ion-nav-back-button>
</ion-nav-bar>
<ion-content>
<div class="list">
<div class="item">
<span translate>Version</span>
<span class="item-note">
{{externalSource.version}}
</span>
</div>
<div ng-include="'views/includes/walletItem.html'"></div>
<div ng-if="!hardwareConnected" class="warning centered">
<span translate>Hardware not connected.</span><br>
<span translate>Check installation and retry.</span>
</div>
<div class="padding">
<button class="button button-standard button-assertive" ng-click="showMneumonicFromHardwarePopup()">
{{'Show Recovery Phrase'|translate}}
</button>
<div ng-if="hardwareConnected">
<div class="list">
<div class="item">
<span translate>Version</span>
<span class="item-note">
{{externalSource.version || 'hardware disconnected'}}
</span>
</div>
</div>
<div class="padding">
<button class="button button-standard button-assertive" ng-click="showMneumonicFromHardwarePopup()">
{{'Show Recovery Phrase'|translate}}
</button>
</div>
</div>
</ion-content>
</ion-view>