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) { angular.module('copayApp.controllers').controller('preferencesExternalController', function($scope, $stateParams, lodash, gettextCatalog, popupService, profileService, walletService) {
var wallet = profileService.getWallet($stateParams.walletId); var wallet = profileService.getWallet($stateParams.walletId);
$scope.wallet = wallet;
$scope.externalSource = lodash.find(walletService.externalSource, function(source) { $scope.externalSource = lodash.find(walletService.externalSource, function(source) {
return source.id == wallet.getPrivKeyExternalSourceName(); return source.id == wallet.getPrivKeyExternalSourceName();
}); });
$scope.hardwareConnected = $scope.externalSource.version.length > 0;
$scope.showMneumonicFromHardwarePopup = function() { $scope.showMneumonicFromHardwarePopup = function() {
var title = gettextCatalog.getString('Warning!'); var title = gettextCatalog.getString('Warning!');
var message = gettextCatalog.getString('Are you being watched? Anyone with your recovery phrase can access or spend your bitcoin.'); 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 { .icon-bitpay {
background-image: url("../img/icon-bitpay.svg"); background-image: url("../img/icon-bitpay.svg");
} }
.warning {
color: $v-warning-color;
}
.centered {
width: 100%;
text-align: center;
}
.disabled { .disabled {
color: $v-light-gray; color: $v-light-gray;
} }

View File

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