Wallet/src/js/controllers/preferencesExternal.js

28 lines
1.1 KiB
JavaScript
Raw Normal View History

2016-12-05 17:33:46 -05:00
'use strict';
angular.module('copayApp.controllers').controller('preferencesExternalController', function($scope, $stateParams, lodash, gettextCatalog, popupService, profileService, walletService) {
2016-12-05 17:33:46 -05:00
var wallet = profileService.getWallet($stateParams.walletId);
$scope.externalSource = lodash.find(walletService.externalSource, function(source) {
return source.id == wallet.getPrivKeyExternalSourceName();
2017-03-21 10:09:50 -04:00
});
2016-12-05 17:33:46 -05:00
2017-04-07 17:12:02 -04:00
if ($scope.externalSource.isEmbeddedHardware) {
2017-04-07 10:54:30 -04:00
$scope.hardwareConnected = $scope.externalSource.version.length > 0;
2017-04-07 10:54:30 -04:00
$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.');
popupService.showConfirm(title, message, null, null, function(res) {
if (res) {
walletService.showMneumonicFromHardware(wallet, function(err) {
if (err) {
popupService.showAlert(gettextCatalog.getString('Error'), err.message || err);
}
});
}
});
};
}
2016-12-05 17:33:46 -05:00
});